home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Technology Seed / ADC Seed CD - July 1999.toast / FireWire / FireWire 2.1 SDK DR3 / Interfaces / FireWire.h next >
Encoding:
Text File  |  1999-05-17  |  109.2 KB  |  3,400 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        FireWire.h
  3.  
  4.     Contains:    Definitions and interfaces for FireWire driver family.
  5.  
  6.     Version:    1.0
  7.  
  8.     Copyright:    © 1996-1999 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     File Ownership:
  11.  
  12.         DRI:                Eric Anderson
  13.  
  14.         Other Contact:        
  15.  
  16.         Technology:            FireWire
  17.  
  18.     Writers:
  19.  
  20.         (EA)    Eric Anderson (ewa)
  21.         (CP)    Collin Pieper
  22.         (DCB)    Clinton Bauder
  23.         (ES)    Erik Staats
  24.         (jkl)    Jay Lloyd
  25.  
  26.     Change History (most recent first):
  27.  
  28.      <FW137>     5/10/99    EA        Fixed comment regarding kFireWireVersion.
  29.      <FW136>      5/1/99    EA        Added best speed and size fields to FWIMOptimizeParamsStruct.
  30.      <FW135>     4/24/99    EA        Changed FWSetRetryResponseOnAckDataErr to FWSetFWDeviceFlags and
  31.                                     FWGetFWDeviceFlags.  Added flag defs.
  32.      <FW134>     3/31/99    EA        Added node ID table to SetAsynchFiltersParams.  Added prototype
  33.                                     for FWSetRetryResponseOnAckDataErr.
  34.      <FW133>     3/29/99    EA        Added FWIMOptimizeParams struct, dispatch, etc.
  35.      <FW132>     3/24/99    EA        Changed fwimState in FWIMSetFWIMStateParamsStruct from Boolean
  36.                                     to UInt32.
  37.      <FW131>     3/22/99    CP        Added FWAllocatePCRAddressSpace prototype and kFWPCRAddressSpace
  38.                                     flag.
  39.      <FW130>     3/20/99    EA        Updated FireWire version to 2.1 (kFireWireVersion).
  40.      <FW129>     3/19/99    CP        Fixed flag definition conflict between kFWAddressPhysical and
  41.                                     kFWWriteCompleteNotify.  kFWAddressPhysical is now an address
  42.                                     location and the location field has been expanded by a bit to
  43.                                     fit the additional location type.
  44.      <FW128>     3/18/99    CP        Added a kFWAddressSecondary flag.
  45.      <FW127>      3/8/99    EA        Added kFWAddressPhysical flag.
  46.      <FW126>     1/21/99    DCB        Add FWWaitForDeviceRePlug.
  47.      <FW125>     1/17/99    EA        Added FWCommandObjectID to FWClientPowerNotifyParamsStruct.
  48.      <FW124>      1/3/99    EA        Added speed to FWClientAsynchRequestParamsStruct so that clients
  49.                                     can learn and control the speeds of request/response packets, if
  50.                                     needed (for example, an SBP-2 target emulator).  Also added
  51.                                     kFWAsynchOverrideSpeed constant for asynch transfer flags.
  52.                                     Added prototypes of set/get speed functions.
  53.      <FW123>      1/3/99    EA        Put ; after new enum. D'oh.
  54.      <FW122>      1/3/99    EA        Added notificationEvent constants for cable power events.
  55.      <FW121>      1/3/99    EA        Added stuff for cable power management.
  56.      <FW120>     12/7/98    EA        Added prototype for FWInstallNewFWIM for CardBus.
  57.      <FW119>     9/20/98    EA        Added SBP-2 API selectors and command object types.
  58.      <FW118>      9/1/98    EA        Added FWAllocatePhysicalAddressSpace prototype.
  59.      <FW117>     8/24/98    EA        Added FWGetCycleTime prototype, and FWIM dispatch table entry.
  60.                                     Changed fwimPollInterruptsProcPtr to fwimPollInterruptsProc.
  61.      <FW116>      8/2/98    EA        Added selectors for SBP-2 notifications.
  62.      <FW115>     7/24/98    jkl        Changed gestalt hasPorts selector from 0 to 1. This selector is
  63.                                     for bit 0 in the FireWire gestalt attributes. Also updated
  64.                                     version for FSL.
  65.      <FW114>     7/24/98    DCB        Add some comments regarding SetFWIMState.
  66.      <FW113>     7/17/98    DCB        Added a new FWIM command -  FWIMSetFWIMState for sleeping or
  67.                                     quiescing FWIMs.
  68.      <FW112>      7/5/98    EA        Add param to FWIMSetCSRROMParamsStruct so that the CSR ROM can't
  69.                                     be read while it is being updated. Also added FWIM Features
  70.                                     flags and FWIMInitializeParams for feature flags and CSR ROM Map
  71.                                     length. Add more 1.1 FWIM API declarations.
  72.      <FW111>      7/1/98    EA        Add services for OpenHCI FWIMs.
  73.      <FW110>      6/9/98    jkl        Corrected PHY packet tCode to 0x0E, or 14, not 13.
  74.      <FW109>      6/5/98    jkl        Added PHY packet transmit tcode define.
  75.      <FW108>      6/5/98    jkl        Corrected AckBusy defines.
  76.      <FW107>     4/21/98    DCB        Adding some more stuff for self-id packets 1-3.
  77.      <FW106>      3/9/98    DCB        Fleshing out self-id packet definitions.
  78.        <105>     2/11/98    DCB        Adding FWIMEnableVMUserCode and FWIMDisableVMUserCode. This file
  79.                                     needs to be changed into a .i file so we can keep future APIs in
  80.                                     here where they belong without making life difficult for DDK
  81.                                     releases.
  82.        <104>     1/15/98    jkl        Update for new interfaces.
  83.        <103>    11/14/97    jkl        Add defines for FireWire Gestalt.
  84.      <FW102>     3/14/97    ES        Changed error code values to one's we've been allocated.
  85.      <FW101>      3/3/97    ES        Added DCLTimeStamp.
  86.      <FW100>     2/20/97    ES        Rearranged FWClientAsynchRequestParams, removed buffer, and
  87.                                     added receiveBuffer, transmitBuffer, and responseCode.
  88.       <FW99>     2/14/97    ES        Added FWIMFinalize and FWIMPollInterrupts to FWIM plug in
  89.                                     dispatch table.
  90.       <FW98>     2/14/97    ES        Moved transfer buffer packet size into the transfer buffer DCL
  91.                                     and removed the set packet size DCL.
  92.       <FW97>     2/14/97    ES        Added procedure prototype for FWModifyDCLList and added some
  93.                                     defs for DCL opcode flags.
  94.       <FW96>      2/6/97    ES        Removed some private fields from FWClientInterfaceParams.
  95.       <FW95>      2/6/97    ES        Removed some private fields from FWIMCommandParams record. Added
  96.                                     procedure prototypes for registering protocol drivers.
  97.       <FW94>      2/4/97    ES        Added private and initial unit address space allocation options
  98.                                     to FWAllocateAddressSpace. Added defs for initial memory,
  99.                                     private, and initial unit address spaces. Added support for
  100.                                     offset entries to FWCSRROMCreateEntry.
  101.       <FW93>     1/27/97    ES        Changed protocol driver file type to 'ndrv'. Fixes bug #1621930.
  102.       <FW92>     1/16/97    ES        Changed CSR ROM search key bit constant names. Added procedure
  103.                                     prototype for FWCSRROMDisposeEntry.
  104.       <FW91>      1/9/97    ES        Added includes so this file can compile by itself.
  105.       <FW90>      1/8/97    ES        Changed defs for kInvalidCSRROMEntryType and
  106.                                     kImmediateCSRROMEntryType. Added generation and sourceID fields
  107.                                     to FWClientAsynchRequestParams. Added procedure prototypes for
  108.                                     FWGetFWDeviceIDFromFWReferenceID, FWFindFWDeviceFromNodeID, and
  109.                                     FWGetUnitCSRROMEntryID.
  110.       <FW89>      1/1/97    ES        Added FWUpdateDCLList. Changed the DCL notification interface.
  111.                                     Changed DCL event defs to kFWDCL<Event>Event.
  112.       <FW88>    12/27/96    ES        Added a bunch of procedure prototypes.
  113.       <FW87>    12/27/96    ES        Changed a bunch of "FWDriver"s to "FWClient"s and added support
  114.                                     for protocol drivers, clients, and units.
  115.       <FW86>    12/26/96    ES        Added support for DCL program stop and release procs.
  116.       <FW85>    12/16/96    ES        Changed to work with new read/write/lock request/complete
  117.                                     processing mechanism.
  118.       <FW84>    12/26/96    ES        Consolidated some parameters in asynch FWIM commands and
  119.                                     processing.
  120.       <FW83>    12/22/96    ES        Changed IsochPortAction to IsochPortControl.
  121.       <FW82>    12/12/96    ES        Took transmit buffer out of FWIMProcessAsynchParams record.
  122.       <FW81>    12/11/96    ES        Removed some fields from FWIMProcessAsynchParams. Changed
  123.                                     FWIMProcess routines to return OSStatus.
  124.       <FW80>    12/10/96    ES        Added defs for isochronous channel force stop notification.
  125.       <FW79>     12/6/96    ES        Changed FWIMInstallParams to FWIMInitializeParams and changed
  126.                                     some of the fields in FWIMInitializeParams.
  127.                                     FWIMAsynchCommandParams were changed to supply the split
  128.                                     transaction timeout.
  129.       <FW78>     12/6/96    ES        Added FWClippedSubtract.
  130.       <FW77>     12/3/96    ES        Added kFWFixedAddress flag to FWAllocateAddressSpace.
  131.       <FW76>    11/27/96    ES        Added retryExceededErr.
  132.       <FW75>    11/26/96    ES        Added procedure prototype for FWStartDCLProgram.
  133.       <FW74>    11/11/96    ES        Added GetUniqueID FWIM command and FWDeallocateAddressSpace.
  134.       <FW73>     11/5/96    ES        Added stuff for FireWire deferred tasks.
  135.       <FW72>    10/18/96    ES        Added kDCLSendBufferOp and kDCLSetPacketSizeOp. Changed the
  136.                                     definition of DCL compiler notification procs. Added a number of
  137.                                     DCL procedure prototypes.
  138.       <FW71>    10/16/96    ES        Added stuff for bus management notification. Also, added
  139.                                     disconnectedErr.
  140.       <FW70>     10/4/96    ES        Added procedure prototype for FWCallDCLCallProc.
  141.       <FW69>     10/4/96    ES        Replaced DCLSetPacketAttributes command with DCLSetTagSyncBits
  142.                                     command. Added DCLSetPacketWithHeaderStart command.
  143.       <FW68>     10/3/96    ES        Added FWIMPluginDispatchTable stuff.
  144.       <FW67>     10/3/96    ES        Removed GetTopologyMap FWIM command. Made FWGetTopologyMap
  145.                                     immediate. Added FWProcessSelfIDs.
  146.       <FW66>     9/27/96    ES        Added procedure prototypes for routines to set and get driver
  147.                                     interface procs and removed driver interface table from
  148.                                     FWRegisterDriver.
  149.       <FW65>     9/26/96    ES        Added kFWAsynchFailOnBusReset.
  150.       <FW64>     9/26/96    ES        Added separateBusErr.
  151.       <FW63>     9/25/96    ES        Added kFWAsynchAbsoluteAddress.
  152.       <FW62>     9/25/96    ES        Added FWIM asynchronous transaction response commands. Changed
  153.                                     FWIMProcessAsynchParams record.
  154.       <FW61>     9/20/96    ES        Added kFWAsynchDisableAddressIncrement to allow disabling of
  155.                                     automatic address incrementing on asynchronous transfers.
  156.       <FW60>     9/16/96    ES        Changed FWIM and FireWire driver interfaces to return command
  157.                                     acceptance.
  158.       <FW59>     9/16/96    ES        Added response code field to FWIMProcessAsynchRequestParams.
  159.                                     Took out some unused constants and data structures.
  160.       <FW58>     9/16/96    ES        Fixed defs for kFWIsochTCode and kFWIsochTag.
  161.       <FW57>     9/11/96    ES        Changed maxRetries for FCP commands to be UInt32 instead of
  162.                                     SInt32.
  163.       <FW56>     9/11/96    ES        Added kFWMaxNodeHops, kFWTopologyMapMaxSelfIDs, and FWSpeedMap
  164.                                     defs. Added speed parameter to FWIMAsynchCommandParams.
  165.       <FW55>      9/5/96    ES        Added fwDriverAsynchRequestParams to FWIMProcessAsynchParams
  166.                                     record and changed completionProcData in FWIMProcessParams
  167.                                     record to a UInt32.
  168.       <FW54>      9/4/96    ES        Added procedure prototype for FWDeallocateIsochronousChannelID.
  169.       <FW53>      9/3/96    ES        Added driver reset notification.
  170.       <FW52>      9/3/96    ES        Added kFWIMSendLinkOnPacket.
  171.       <FW51>     8/30/96    ES        Added a bunch of stuff for isochronous resource management.
  172.       <FW50>     8/29/96    ES        Added set and clear contender bit FWIM commands.
  173.       <FW49>     8/29/96    ES        Changed FWRegisterDriver to take driver interface proc table.
  174.       <FW48>     8/28/96    ES        Added procedure prototypes for FWProcessLockRequest. Added def
  175.                                     for kFWDriverLock. Added extendedTCode to some asynch command
  176.                                     parameter records.
  177.       <FW47>     8/28/96    ES        Added kFWAsynchOverrideMaxPayload to asynch transfer flags.
  178.       <FW46>     8/26/96    ES        Put back kInvalidFWGenerationNumber.
  179.       <FW45>     8/26/96    ES        Changed to new command object interface.
  180.       <FW44>     8/26/96    ES        Added local node ID to FWIMGetTopologyMapParams record, added
  181.                                     FWGetLocalFWReferenceIDFromFWReferenceID, and changed some
  182.                                     constant names.
  183.       <FW43>     8/16/96    ES        Added immediate modes. Changed FWAllocateIsochPort to take
  184.                                     FWAllocateIsochPortParams.
  185.       <FW42>     8/15/96    ES        Added defs for queueing for FW driver commands. Added procedure
  186.                                     prototypes for dynamically changing destination of DCL jump
  187.                                     commands. Added defs for making isoch channel and port routines
  188.                                     asynchronous.
  189.       <FW41>      8/8/96    ES        Added FWTranslateDCLProgram.
  190.       <FW40>      8/2/96    ES        Replaced IsochBufferChains with DCLPrograms.
  191.       <FW39>     7/31/96    ES        Changed to implement new isochronous buffering architecture.
  192.       <FW38>      7/8/96    ES        Added support for isochronous transmission. Added FWClippedAdd.
  193.                                     Added IRM allocation option to FWAllocateIsochronousChannelID.
  194.       <FW37>     6/24/96    ES        Added FWCompareAndSwap.
  195.       <FW36>     6/20/96    ES        Made this look more like a .i generated interface.
  196.       <FW35>     6/14/96    ES        Added FWUnregisterDriver.
  197.       <FW34>     5/31/96    ES        Took out expert notification stuff and added some virtual device
  198.                                     defs.
  199.       <FW33>     4/29/96    ES        Cleaned up FWCSRROMCreateEntryID procedure prototype.
  200.       <FW32>     4/17/96    ES        Changed and added some procedure prototypes.
  201.       <FW31>     4/15/96    ES        Got rid of stuff for FWDriverInstall and added stuff for
  202.                                     FWRegisterDriver.
  203.       <FW30>      4/5/96    ES        Added a bunch of CSRROM service procedure prototypes.
  204.       <FW29>     3/29/96    ES        Moved some of the virtual device stuff here from the private
  205.                                     header.
  206.       <FW28>     3/25/96    ES        Added support for asynch request packet handling by drivers.
  207.       <FW27>     3/12/96    ES        Added FWVDeviceID.
  208.       <FW26>      3/8/96    ES        Add stuff for creating CSR configuration ROM entries on the
  209.                                     local host.
  210.       <FW25>      3/7/96    ES        Changed stuff with address spaces and FWIM processing requests.
  211.       <FW24>     2/22/96    ES        Added stuff for FWIsochResourceManagerID.
  212.       <FW23>     2/21/96    ES        Added fwimData to IsochChannelBufferStruct, changed fwimData to
  213.                                     a UInt32 in IsochBufferChainStruct, and added isochChannelID to
  214.                                     FWDriverIsochPortParamsStruct.
  215.       <FW22>     2/21/96    ES        Added a bunch of atomic operations.
  216.       <FW21>     2/16/96    ES        Added procedure prototypes for FWAllocateIsochBufferChainID and
  217.                                     FWDeallocateIsochBufferChainID and changed some stuff for
  218.                                     isochronous ports.
  219.       <FW20>      2/9/96    ES        Added stuff for FWGetTopologyMap and for synchronizing the
  220.                                     services queue.
  221.       <FW19>      2/7/96    ES        Added kInvalidNodeID.
  222.       <FW18>      2/7/96    ES        Added FWThresholdAdd and FWThresholdSubtract and a whole bunch
  223.                                     of other stuff for doing lock transactions.
  224.       <FW17>      2/2/96    ES        Added stuff for disabling the FWIM command queue and specifying
  225.                                     the bus generation number in FireWire asynch commands.
  226.       <FW16>      2/1/96    ES        Added kFWIMCommandPriorityFlag, kFWInterfacePriorityFlag, and
  227.                                     busReconfiguredErr.
  228.       <FW15>     1/30/96    ES        Added stuff for doing bus resets.
  229.       <FW14>     1/30/96    ES        Defined kFWRequestWaiting and changed pNextFWInterfaceParams in
  230.                                     FWInterfaceParamsStruct from FWInterfaceParamsPtr * to
  231.                                     FWInterfaceParamsPtr.
  232.       <FW13>     1/26/96    ES        Added FWSetMaxPayloadSize and other maxPayload stuff.
  233.       <FW12>     1/24/96    ES        Added responseHandler and settable timeout to FCP command
  234.                                     params.
  235.       <FW11>     1/18/96    ES        Added function prototypes for task and software interrupt
  236.                                     services. Changed kMaxSelfIDPacketsPerNode to 9.
  237.       <FW10>     1/12/96    ES        Added FWReleaseIsochronousChannel and
  238.                                     FWReleaseLocalIsochronousPort. Changed kFWInvalidFWIMCommandID
  239.                                     to kInvalidFWIMCommandID.
  240.        <FW9>     1/12/96    ES        Added flags to FWIMCommandParams.
  241.        <FW8>     1/11/96    ES        Changed request and interface to command in most of the FWIM
  242.                                     stuff.
  243.        <FW7>     1/11/96    ES        Changed calling parameters for FWCommandIsComplete and changed
  244.                                     to FWIMCommandIsComplete. Added stuff for FWIMCommandIDs.
  245.        <FW6>     1/10/96    ES        Added prototype for FWProcessBusReset.
  246.        <FW5>      1/9/96    ES        Added FWProcessWriteRequest and removed kFWWriteNotify.
  247.        <FW4>      1/9/96    ES        Really got rid of kFWFWIMRequestCompleteNotify.
  248.        <FW3>      1/9/96    ES        Added FWCommandIsComplete. Removed kFWFWIMRequestCompleteNotify.
  249.        <FW2>      1/6/96    ES        Fill in contains and written by fields.
  250.        <FW1>      1/6/96    ES        first checked in
  251.  
  252. */
  253.  
  254. #ifndef __FIREWIRE__
  255. #define __FIREWIRE__
  256.  
  257. #ifndef __TYPES__
  258. #include <Types.h>
  259. #endif
  260.  
  261. #ifndef __DRIVERSERVICES__
  262. #include <DriverServices.h>
  263. #endif
  264.  
  265. #ifdef __cplusplus
  266. extern "C" {
  267. #endif
  268.  
  269. #if PRAGMA_IMPORT_SUPPORTED
  270. #pragma import on
  271. #endif
  272.  
  273. #if PRAGMA_ALIGN_SUPPORTED
  274. #pragma options align=mac68k
  275. #endif
  276.  
  277.  
  278. // Generic bit defs.
  279.  
  280. enum
  281. {
  282.     kBit0                        = (1 << 0),
  283.     kBit1                        = (1 << 1),
  284.     kBit2                        = (1 << 2),
  285.     kBit3                        = (1 << 3),
  286.     kBit4                        = (1 << 4),
  287.     kBit5                        = (1 << 5),
  288.     kBit6                        = (1 << 6),
  289.     kBit7                        = (1 << 7),
  290.     kBit8                        = (1 << 8),
  291.     kBit9                        = (1 << 9),
  292.     kBit10                        = (1 << 10),
  293.     kBit11                        = (1 << 11),
  294.     kBit12                        = (1 << 12),
  295.     kBit13                        = (1 << 13),
  296.     kBit14                        = (1 << 14),
  297.     kBit15                        = (1 << 15),
  298.     kBit16                        = (1 << 16),
  299.     kBit17                        = (1 << 17),
  300.     kBit18                        = (1 << 18),
  301.     kBit19                        = (1 << 19),
  302.     kBit20                        = (1 << 20),
  303.     kBit21                        = (1 << 21),
  304.     kBit22                        = (1 << 22),
  305.     kBit23                        = (1 << 23),
  306.     kBit24                        = (1 << 24),
  307.     kBit25                        = (1 << 25),
  308.     kBit26                        = (1 << 26),
  309.     kBit27                        = (1 << 27),
  310.     kBit28                        = (1 << 28),
  311.     kBit29                        = (1 << 29),
  312.     kBit30                        = (1 << 30),
  313.     kBit31                        = (1 << 31)
  314. };
  315.  
  316. #define BitRange(start, end)                        \
  317. (                                                    \
  318.     ((((UInt32) 0xFFFFFFFF) << (31 - (end))) >>        \
  319.      ((31 - (end)) + (start))) <<                    \
  320.     (start)                                            \
  321. )
  322.  
  323. #define BitRangePhase(start, end)                    \
  324.     (start)
  325.  
  326.  
  327. ////////////////////////////////////////////////////////////////////////////////
  328. //
  329. // Standard FireWire defs.
  330. //
  331.  
  332. // FireWire bit defs.
  333.  
  334. enum
  335. {
  336.     kFWBit0                        = (1 << 31),
  337.     kFWBit1                        = (1 << 30),
  338.     kFWBit2                        = (1 << 29),
  339.     kFWBit3                        = (1 << 28),
  340.     kFWBit4                        = (1 << 27),
  341.     kFWBit5                        = (1 << 26),
  342.     kFWBit6                        = (1 << 25),
  343.     kFWBit7                        = (1 << 24),
  344.     kFWBit8                        = (1 << 23),
  345.     kFWBit9                        = (1 << 22),
  346.     kFWBit10                    = (1 << 21),
  347.     kFWBit11                    = (1 << 20),
  348.     kFWBit12                    = (1 << 19),
  349.     kFWBit13                    = (1 << 18),
  350.     kFWBit14                    = (1 << 17),
  351.     kFWBit15                    = (1 << 16),
  352.     kFWBit16                    = (1 << 15),
  353.     kFWBit17                    = (1 << 14),
  354.     kFWBit18                    = (1 << 13),
  355.     kFWBit19                    = (1 << 12),
  356.     kFWBit20                    = (1 << 11),
  357.     kFWBit21                    = (1 << 10),
  358.     kFWBit22                    = (1 << 9),
  359.     kFWBit23                    = (1 << 8),
  360.     kFWBit24                    = (1 << 7),
  361.     kFWBit25                    = (1 << 6),
  362.     kFWBit26                    = (1 << 5),
  363.     kFWBit27                    = (1 << 4),
  364.     kFWBit28                    = (1 << 3),
  365.     kFWBit29                    = (1 << 2),
  366.     kFWBit30                    = (1 << 1),
  367.     kFWBit31                    = (1 << 0)
  368. };
  369.  
  370. #define FWBitRange(start, end)                        \
  371. (                                                    \
  372.     ((((UInt32) 0xFFFFFFFF) << (start)) >>            \
  373.      ((start) + (31 - (end)))) <<                    \
  374.     (31 - (end))                                    \
  375. )
  376.  
  377. #define FWBitRangePhase(start, end)                    \
  378.     (31 - end)
  379.  
  380.  
  381. /*zzz Put in IEEE1212.h */
  382. ////////////////////////////////////////////////////////////////////////////////
  383. //
  384. // Define some CSR stuff.
  385. //
  386.  
  387. // CSR bit defs.
  388.  
  389. enum
  390. {
  391.     kCSRBit0                    = (1 << 31),
  392.     kCSRBit1                    = (1 << 30),
  393.     kCSRBit2                    = (1 << 29),
  394.     kCSRBit3                    = (1 << 28),
  395.     kCSRBit4                    = (1 << 27),
  396.     kCSRBit5                    = (1 << 26),
  397.     kCSRBit6                    = (1 << 25),
  398.     kCSRBit7                    = (1 << 24),
  399.     kCSRBit8                    = (1 << 23),
  400.     kCSRBit9                    = (1 << 22),
  401.     kCSRBit10                    = (1 << 21),
  402.     kCSRBit11                    = (1 << 20),
  403.     kCSRBit12                    = (1 << 19),
  404.     kCSRBit13                    = (1 << 18),
  405.     kCSRBit14                    = (1 << 17),
  406.     kCSRBit15                    = (1 << 16),
  407.     kCSRBit16                    = (1 << 15),
  408.     kCSRBit17                    = (1 << 14),
  409.     kCSRBit18                    = (1 << 13),
  410.     kCSRBit19                    = (1 << 12),
  411.     kCSRBit20                    = (1 << 11),
  412.     kCSRBit21                    = (1 << 10),
  413.     kCSRBit22                    = (1 << 9),
  414.     kCSRBit23                    = (1 << 8),
  415.     kCSRBit24                    = (1 << 7),
  416.     kCSRBit25                    = (1 << 6),
  417.     kCSRBit26                    = (1 << 5),
  418.     kCSRBit27                    = (1 << 4),
  419.     kCSRBit28                    = (1 << 3),
  420.     kCSRBit29                    = (1 << 2),
  421.     kCSRBit30                    = (1 << 1),
  422.     kCSRBit31                    = (1 << 0)
  423. };
  424.  
  425. #define CSRBitRange(start, end)                        \
  426. (                                                    \
  427.     ((((UInt32) 0xFFFFFFFF) << (start)) >>            \
  428.      ((start) + (31 - (end)))) <<                    \
  429.     (31 - (end))                                    \
  430. )
  431.  
  432. #define CSRBitRangePhase(start, end)                \
  433.     (31 - end)
  434.  
  435. // Core CSR registers.
  436.  
  437. enum
  438. {
  439.     kCSRStateUnitDepend            = CSRBitRange (0, 15),
  440.     kCSRStateUnitDependPhase    = CSRBitRangePhase (0, 15),
  441.  
  442.     kCSRStateBusDepend            = CSRBitRange (16, 23),
  443.     kCSRStateBusDependPhase        = CSRBitRangePhase (16, 23),
  444.  
  445.     kCSRStateLost                = kCSRBit24,
  446.     kCSRStateDReq                = kCSRBit25,
  447.     kCSRStateELog                = kCSRBit27,
  448.     kCSRStateAtn                = kCSRBit28,
  449.     kCSRStateOff                = kCSRBit29,
  450.  
  451.     kCSRStateState                = CSRBitRange (30, 31),
  452.     kCSRStateStatePhase            = CSRBitRangePhase (30, 31),
  453.     kCSRStateStateRunning        = 0,
  454.     kCSRStateStateInitializing    = 1,
  455.     kCSRStateStateTesting        = 2,
  456.     kCSRStateStateDead            = 3
  457. };
  458.  
  459. // Key values.
  460.  
  461. enum
  462. {
  463.     kCSRTextualDescriptorKey    = 0x01,
  464.     kCSRBusDependentInfoKey        = 0x02,
  465.     kCSRModuleVendorIDKey        = 0x03,
  466.     kCSRModuleHwVersionKey        = 0x04,
  467.     kCSRModuleSpecIdKey            = 0x05,
  468.     kCSRModuleSwVersionKey        = 0x06,
  469.     kCSRModuleDependentInfoKey    = 0x07,
  470.     kCSRNodeVendorIdKey            = 0x08,
  471.     kCSRNodeHwVersionKey        = 0x09,
  472.     kCSRNodeSpecIdKey            = 0x0A,
  473.     kCSRNodeSwVersionKey        = 0x0B,
  474.     kCSRNodeCapabilitiesKey        = 0x0C,
  475.     kCSRNodeUniqueIdKey            = 0x0D,
  476.     kCSRNodeUnitsExtentKey        = 0x0E,
  477.     kCSRNodeMemoryExtentKey        = 0x0F,
  478.     kCSRNodeDependentInfoKey    = 0x10,
  479.     kCSRUnitDirectoryKey        = 0x11,
  480.     kCSRUnitSpecIdKey            = 0x12,
  481.     kCSRUnitSwVersionKey        = 0x13,
  482.     kCSRUnitDependentInfoKey    = 0x14,
  483.     kCSRUnitLocationKey            = 0x15,
  484.     kCSRUnitPollMaskKey            = 0x16
  485. };
  486.  
  487.  
  488. // Key value bits for searching.
  489.  
  490. enum
  491. {
  492.     kCSREveryKey                = 0xFFFFFFFF,
  493.  
  494.     kCSRTextualDescriptorKeyLoBit    = (1 << kCSRTextualDescriptorKey),
  495.     kCSRTextualDescriptorKeyHiBit    = 0,
  496.     kCSRBusDependentInfoKeyLoBit    = (1 << kCSRBusDependentInfoKey),
  497.     kCSRBusDependentInfoKeyHiBit    = 0,
  498.     kCSRModuleVendorIDKeyLoBit        = (1 << kCSRModuleVendorIDKey),
  499.     kCSRModuleVendorIDKeyHiBit        = 0,
  500.     kCSRModuleHwVersionKeyLoBit        = (1 << kCSRModuleHwVersionKey),
  501.     kCSRModuleHwVersionKeyHiBit        = 0,
  502.     kCSRModuleSpecIdKeyLoBit        = (1 << kCSRModuleSpecIdKey),
  503.     kCSRModuleSpecIdKeyHiBit        = 0,
  504.     kCSRModuleSwVersionKeyLoBit        = (1 << kCSRModuleSwVersionKey),
  505.     kCSRModuleSwVersionKeyHiBit        = 0,
  506.     kCSRModuleDependentInfoKeyLoBit    = (1 << kCSRModuleDependentInfoKey),
  507.     kCSRModuleDependentInfoKeyHiBit    = 0,
  508.     kCSRNodeVendorIdKeyLoBit        = (1 << kCSRNodeVendorIdKey),
  509.     kCSRNodeVendorIdKeyHiBit        = 0,
  510.     kCSRNodeHwVersionKeyLoBit        = (1 << kCSRNodeHwVersionKey),
  511.     kCSRNodeHwVersionKeyHiBit        = 0,
  512.     kCSRNodeSpecIdKeyLoBit            = (1 << kCSRNodeSpecIdKey),
  513.     kCSRNodeSpecIdKeyHiBit            = 0,
  514.     kCSRNodeSwVersionKeyLoBit        = (1 << kCSRNodeSwVersionKey),
  515.     kCSRNodeSwVersionKeyHiBit        = 0,
  516.     kCSRNodeCapabilitiesKeyLoBit    = (1 << kCSRNodeCapabilitiesKey),
  517.     kCSRNodeCapabilitiesKeyHiBit    = 0,
  518.     kCSRNodeUniqueIdKeyLoBit        = (1 << kCSRNodeUniqueIdKey),
  519.     kCSRNodeUniqueIdKeyHiBit        = 0,
  520.     kCSRNodeUnitsExtentKeyLoBit        = (1 << kCSRNodeUnitsExtentKey),
  521.     kCSRNodeUnitsExtentKeyHiBit        = 0,
  522.     kCSRNodeMemoryExtentKeyLoBit    = (1 << kCSRNodeMemoryExtentKey),
  523.     kCSRNodeMemoryExtentKeyHiBit    = 0,
  524.     kCSRNodeDependentInfoKeyLoBit    = (1 << kCSRNodeDependentInfoKey),
  525.     kCSRNodeDependentInfoKeyHiBit    = 0,
  526.     kCSRUnitDirectoryKeyLoBit        = (1 << kCSRUnitDirectoryKey),
  527.     kCSRUnitDirectoryKeyHiBit        = 0,
  528.     kCSRUnitSpecIdKeyLoBit            = (1 << kCSRUnitSpecIdKey),
  529.     kCSRUnitSpecIdKeyHiBit            = 0,
  530.     kCSRUnitSwVersionKeyLoBit        = (1 << kCSRUnitSwVersionKey),
  531.     kCSRUnitSwVersionKeyHiBit        = 0,
  532.     kCSRUnitDependentInfoKeyLoBit    = (1 << kCSRUnitDependentInfoKey),
  533.     kCSRUnitDependentInfoKeyHiBit    = 0,
  534.     kCSRUnitLocationKeyLoBit        = (1 << kCSRUnitLocationKey),
  535.     kCSRUnitLocationKeyHiBit        = 0,
  536.     kCSRUnitPollMaskKeyLoBit        = (1 << kCSRUnitPollMaskKey),
  537.     kCSRUnitPollMaskKeyHiBit        = 0
  538. };
  539.  
  540.  
  541. // Key types.
  542.  
  543. enum
  544. {
  545.     kCSRImmediateKeyType        = 0,
  546.     kCSROffsetKeyType            = 1,
  547.     kCSRLeafKeyType                = 2,
  548.     kCSRDirectoryKeyType        = 3
  549. };
  550.  
  551.  
  552. // Key type bits for searching.
  553.  
  554. enum
  555. {
  556.     kCSREveryKeyType            = 0xFFFFFFFF,
  557.  
  558.     kCSRImmediateKeyTypeBit        = (1 << kCSRImmediateKeyType),
  559.     kCSROffsetKeyTypeBit        = (1 << kCSROffsetKeyType),
  560.     kCSRLeafKeyTypeBit            = (1 << kCSRLeafKeyType),
  561.     kCSRDirectoryKeyTypeBit        = (1 << kCSRDirectoryKeyType)
  562. };
  563.  
  564. // CSR ROM entry bit locations.
  565.  
  566. enum
  567. {
  568.     kCSRBusInfoBlockLength        = CSRBitRange (0, 7),
  569.     kCSRBusInfoBlockLengthPhase    = CSRBitRangePhase (0, 7),
  570.  
  571.     kCSRROMCRCLength            = CSRBitRange (8, 15),
  572.     kCSRROMCRCLengthPhase        = CSRBitRangePhase (8, 15),
  573.  
  574.     kCSRROMCRCValue                = CSRBitRange (16, 31),
  575.     kCSRROMCRCValuePhase        = CSRBitRangePhase (16, 31),
  576.  
  577.     kCSREntryKeyType            = CSRBitRange (0, 1),
  578.     kCSREntryKeyTypePhase        = CSRBitRangePhase (0, 1),
  579.  
  580.     kCSREntryKeyValue            = CSRBitRange (2, 7),
  581.     kCSREntryKeyValuePhase        = CSRBitRangePhase (2, 7),
  582.  
  583.     kCSREntryValue                = CSRBitRange (8, 31),
  584.     kCSREntryValuePhase            = CSRBitRangePhase (8, 31),
  585.  
  586.     kCSRLeafDirLength            = CSRBitRange (0, 15),
  587.     kCSRLeafDirLengthPhase        = CSRBitRangePhase (0, 15),
  588.  
  589.     kCSRLeafDirCRC                = CSRBitRange (16, 31),
  590.     kCSRLeafDirCRCPhase            = CSRBitRangePhase (16, 31)
  591. };
  592.  
  593. // CSR 64-bit fixed address defs.
  594.  
  595. enum
  596. {
  597.     kCSRNodeID                    = CSRBitRange (0, 15),
  598.     kCSRNodeIDPhase                = CSRBitRangePhase (0, 15),
  599.  
  600.     kCSRInitialMemorySpaceBaseAddressHi
  601.                                 = 0x00000000,
  602.     kCSRInitialMemorySpaceBaseAddressLo
  603.                                 = 0x00000000,
  604.  
  605.     kCSRPrivateSpaceBaseAddressHi
  606.                                 = 0x0000FFFF,
  607.     kCSRPrivateSpaceBaseAddressLo
  608.                                 = 0xE0000000,
  609.  
  610.     kCSRRegisterSpaceBaseAddressHi
  611.                                 = 0x0000FFFF,
  612.     kCSRRegisterSpaceBaseAddressLo
  613.                                 = 0xF0000000,
  614.  
  615.     kCSRCoreRegistersBaseAddress
  616.                                 = kCSRRegisterSpaceBaseAddressLo,
  617.     kCSRStateClearAddress        = kCSRCoreRegistersBaseAddress + 0x0000,
  618.     kCSRStateSetAddress            = kCSRCoreRegistersBaseAddress + 0x0004,
  619.     kCSRNodeIDsAddress            = kCSRCoreRegistersBaseAddress + 0x0008,
  620.     kCSRResetStartAddress        = kCSRCoreRegistersBaseAddress + 0x000C,
  621.     kCSRIndirectAddressAddress    = kCSRCoreRegistersBaseAddress + 0x0010,
  622.     kCSRIndirectDataAddress        = kCSRCoreRegistersBaseAddress + 0x0014,
  623.     kCSRSplitTimeoutHiAddress    = kCSRCoreRegistersBaseAddress + 0x0018,
  624.     kCSRSplitTimeoutLoAddress    = kCSRCoreRegistersBaseAddress + 0x001C,
  625.     kCSRArgumentHiAddress        = kCSRCoreRegistersBaseAddress + 0x0020,
  626.     kCSRArgumentLoAddress        = kCSRCoreRegistersBaseAddress + 0x0024,
  627.     kCSRTestStartAddress        = kCSRCoreRegistersBaseAddress + 0x0028,
  628.     kCSRTestStatusAddress        = kCSRCoreRegistersBaseAddress + 0x002C,
  629.     kCSRUnitsBaseHiAddress        = kCSRCoreRegistersBaseAddress + 0x0030,
  630.     kCSRUnitsBaseLoAddress        = kCSRCoreRegistersBaseAddress + 0x0034,
  631.     kCSRUnitsBoundHiAddress        = kCSRCoreRegistersBaseAddress + 0x0038,
  632.     kCSRUnitsBoundLoAddress        = kCSRCoreRegistersBaseAddress + 0x003C,
  633.     kCSRMemoryBaseHiAddress        = kCSRCoreRegistersBaseAddress + 0x0040,
  634.     kCSRMemoryBaseLoAddress        = kCSRCoreRegistersBaseAddress + 0x0044,
  635.     kCSRMemoryBoundHiAddress    = kCSRCoreRegistersBaseAddress + 0x0048,
  636.     kCSRMemoryBoundLoAddress    = kCSRCoreRegistersBaseAddress + 0x004C,
  637.     kCSRInterruptTargetAddress    = kCSRCoreRegistersBaseAddress + 0x0050,
  638.     kCSRInterruptMaskAddress    = kCSRCoreRegistersBaseAddress + 0x0054,
  639.     kCSRClockValueHiAddress        = kCSRCoreRegistersBaseAddress + 0x0058,
  640.     kCSRClockValueMidAddress    = kCSRCoreRegistersBaseAddress + 0x005C,
  641.     kCSRClockTickPeriodMidAddress
  642.                                 = kCSRCoreRegistersBaseAddress + 0x0060,
  643.     kCSRClockTickPeriodLoAddress
  644.                                 = kCSRCoreRegistersBaseAddress + 0x0064,
  645.     kCSRClockStrobeArrivedHiAddress
  646.                                 = kCSRCoreRegistersBaseAddress + 0x0068,
  647.     kCSRClockStrobeArrivedMidAddress
  648.                                 = kCSRCoreRegistersBaseAddress + 0x006C,
  649.     kCSRClockInfo0Address        = kCSRCoreRegistersBaseAddress + 0x0070,
  650.     kCSRClockInfo1Address        = kCSRCoreRegistersBaseAddress + 0x0074,
  651.     kCSRClockInfo2Address        = kCSRCoreRegistersBaseAddress + 0x0078,
  652.     kCSRClockInfo3Address        = kCSRCoreRegistersBaseAddress + 0x007C,
  653.     kCSRMessageRequestAddress    = kCSRCoreRegistersBaseAddress + 0x0080,
  654.     kCSRMessageResponseAddress    = kCSRCoreRegistersBaseAddress + 0x00C0,
  655.     kCSRErrorLogBufferAddress    = kCSRCoreRegistersBaseAddress + 0x0180,
  656.  
  657.     kCSRBusDependentRegistersBaseAddress
  658.                                 = kCSRRegisterSpaceBaseAddressLo + 0x0200,
  659.  
  660.     kCSRROMBaseAddress            = kCSRRegisterSpaceBaseAddressLo + 0x0400,
  661.     kCSRBIBHeaderAddress        = kCSRROMBaseAddress,
  662.     kCSRBIBBusNameAddress        = kCSRROMBaseAddress + 4
  663. };
  664.  
  665.  
  666. // CSR ROM search data types and structures.
  667.  
  668. enum {
  669. /*
  670.     ** Absolute locations
  671.     */
  672.     kIterateRoot                = 0x2L,
  673. /*
  674.     ** "Upward" Relationships    
  675.     */
  676.     kIterateParents                = 0x3L,                            /* include all  parent(s) of entry */
  677. /*
  678.     ** "Downward" Relationships
  679.     //
  680.     */
  681.     kIterateChildren            = 0x4L,                            /* include all children */
  682.     kIterateSubTrees            = 0x5L,                            /* include all sub trees of entry */
  683.     kIterateDescendants            = 0x5L,                            /* include all descendants of entry */
  684. /*
  685.     ** "Horizontal" Relationships    
  686.     */
  687.     kIterateSibling                = 0x6L,                            /* include all siblings */
  688. /*
  689.     ** Keep doing the same thing
  690.     */
  691.     kIterateContinue            = 0x1L
  692. };
  693.  
  694. enum
  695. {
  696.     kInvalidCSRROMIterator        = 0
  697. };
  698.  
  699. enum
  700. {
  701.     kCSRROMSearchForKey            = 1
  702. };
  703.  
  704. enum
  705. {
  706.     kInvalidCSRROMEntryType        = 0xFFFFFFFF,
  707.     kImmediateCSRROMEntryType    = 0,
  708.     kOffsetCSRROMEntryType        = 1,
  709.     kLeafCSRROMEntryType        = 2,
  710.     kDirectoryCSRROMEntryType    = 3
  711. };
  712.  
  713. enum
  714. {
  715.     kInvalidCSRROMEntryID        = 0                        // zzz should use generic invalid ID
  716. };
  717.  
  718. // CSR defined 64 bit unique ID.
  719.  
  720. struct CSRNodeUniqueIDStruct
  721. {
  722.     UInt32                        hi,
  723.                                 lo;                        // Hi and lo values of 64 bit unique ID.
  724. };
  725. typedef struct CSRNodeUniqueIDStruct
  726.                                 CSRNodeUniqueID,
  727.                                 *CSRNodeUniqueIDPtr;
  728.  
  729. typedef UInt32                    CSRROMEntryIterator;
  730. typedef UInt32                    CSRROMIterationOp;
  731. typedef struct OpaqueCSRROMEntryID*        CSRROMEntryID;
  732.  
  733. struct CSRROMSearchCriteriaStruct
  734. {
  735.     UInt32                        csrROMSearchType;        // Type of search record.
  736.     UInt32                        keyType;                // Key types to search for.
  737.     UInt32                        keyHi,                    // Key values to search for.
  738.                                 keyLo;                    //zzz ought to provide nice way to set these.
  739. };
  740. typedef struct CSRROMSearchCriteriaStruct
  741.                                 CSRROMSearchCriteria,
  742.                                 *CSRROMSearchCriteriaPtr;
  743.  
  744. /*zzz End put in IEEE1212.h */
  745.  
  746.  
  747. ////////////////////////////////////////////////////////////////////////////////
  748. //
  749. // FireWire CSR defs.
  750. //
  751.  
  752. // FireWire core CSR registers.
  753.  
  754. enum
  755. {
  756.     kFWCSRStateGone                = kFWBit16,
  757.     kFWCSRStateLinkOff            = kFWBit22,
  758.     kFWCSRStateCMstr            = kFWBit23
  759. };
  760.  
  761. // FireWire bus/nodeID address defs.
  762.  
  763. enum
  764. {
  765.     kFWAddressBusID                = FWBitRange (16, 25) << kCSRNodeIDPhase,
  766.     kFWAddressBusIDPhase        = FWBitRangePhase (16, 25) + kCSRNodeIDPhase,
  767.  
  768.     kFWAddressNodeID            = FWBitRange (26, 31) << kCSRNodeIDPhase,
  769.     kFWAddressNodeIDPhase        = FWBitRangePhase (26, 31) + kCSRNodeIDPhase,
  770.  
  771.     kFWLocalBusID                = 1023,
  772.     kFWBroadcastNodeID            = 63,
  773.  
  774.     kFWLocalBusAddress            = kFWLocalBusID << kFWAddressBusIDPhase,
  775.     kFWBroadcastAddress            = kFWBroadcastNodeID << kFWAddressNodeIDPhase
  776. };
  777.  
  778. #define FWNodeBaseAddress(busID, nodeID)                                                \
  779. (                                                                                        \
  780.     (busID << kFWAddressBusIDPhase) |                                                    \
  781.     (nodeID << kFWAddressNodeIDPhase)                                                    \
  782. )
  783.  
  784. #define FWNodeRegisterSpaceBaseAddressHi(busID, nodeID)                                    \
  785. (                                                                                        \
  786.     FWNodeBaseAddress (busID, nodeID) |                                                    \
  787.     kCSRRegisterSpaceBaseAddressHi                                                        \
  788. )
  789.  
  790.  
  791. // FireWire CSR bus info block defs.
  792.  
  793. enum
  794. {
  795.     kFWBIBHeaderAddress            = kCSRBIBHeaderAddress,
  796.     kFWBIBBusNameAddress        = kCSRBIBBusNameAddress,
  797.     kFWBIBNodeCapabilitiesAddress
  798.                                 = kCSRROMBaseAddress + 8,
  799.     kFWBIBNodeUniqueIDHiAddress    = kCSRROMBaseAddress + 12,
  800.     kFWBIBNodeUniqueIDLoAddress    = kCSRROMBaseAddress + 16,
  801.  
  802.     kFWBIBBusName                = '1394',
  803.  
  804.     kFWBIBIrmc                    = kFWBit0,
  805.     kFWBIBCmc                    = kFWBit1,
  806.     kFWBIBIsc                    = kFWBit2,
  807.     kFWBIBBmc                    = kFWBit3,
  808.     kFWBIBCycClkAcc                = FWBitRange (8, 15),
  809.     kFWBIBCycClkAccPhase        = FWBitRangePhase (8, 15),
  810.     kFWBIBMaxRec                = FWBitRange (16, 19),
  811.     kFWBIBMaxRecPhase            = FWBitRangePhase (16, 19)
  812. };
  813.  
  814.  
  815. ////////////////////////////////////////////////////////////////////////////////
  816. //
  817. // FireWire ID defs.
  818. //
  819.  
  820. typedef struct OpaqueFWReferenceID*            FWReferenceID;
  821. typedef struct OpaqueFWCommandObjectID*        FWCommandObjectID;
  822. typedef struct OpaqueFWCommandID*            FWCommandID;
  823. typedef struct OpaqueFWIMCommandID*            FWIMCommandID;
  824. typedef struct OpaqueFWClientCommandID*        FWClientCommandID;
  825. typedef struct OpaqueFWIMProcessID*            FWIMProcessID;
  826. typedef struct OpaqueIsochChannelID*        IsochChannelID;
  827. typedef struct OpaqueIsochPortID*            IsochPortID;
  828. typedef struct OpaqueDCLProgramID*            DCLProgramID;
  829. typedef struct OpaqueFWAddressSpaceID*        FWAddressSpaceID;
  830. typedef struct OpaqueFWDeferredTaskID*        FWDeferredTaskID;
  831. typedef FWReferenceID            FWIMID;
  832. typedef FWReferenceID            FWDeviceID;
  833. typedef FWReferenceID            FWUnitID;
  834. typedef FWReferenceID            FWClientID;
  835. typedef FWReferenceID            FWDriverID;
  836. typedef FWReferenceID            FWVDeviceID;
  837. typedef FWReferenceID            FWPDriverID;
  838. typedef FWReferenceID            FWIsochResourceManagerID;
  839.  
  840. enum
  841. {
  842.     kInvalidFWReferenceID        = 0,                    // zzz should use generic invalid ID
  843.     kInvalidFWIMID                = kInvalidFWReferenceID,    // zzz should use generic invalid ID ID for an invalid FWIM
  844.     kInvalidFWDeviceID            = kInvalidFWReferenceID,    // zzz should use generic invalid ID ID for an invalid FWDriver
  845.     kInvalidFWUnitID            = kInvalidFWReferenceID,    // zzz should use generic invalid ID ID for an invalid FWDriver
  846.     kInvalidFWClientID            = kInvalidFWReferenceID,    // zzz should use generic invalid ID ID for an invalid FWDriver
  847.     kInvalidFWDriverID            = kInvalidFWReferenceID,    // zzz should use generic invalid ID ID for an invalid FWDriver
  848.     kInvalidFWVDeviceID            = kInvalidFWReferenceID,    // zzz should use generic invalid ID ID for an invalid FWDriver
  849.     kInvalidFWPDriverID            = kInvalidFWReferenceID,    // zzz should use generic invalid ID ID for an invalid FWDriver
  850.     kInvalidFWIsochResourceManagerID    = kInvalidFWReferenceID,    // zzz should use generic invalid ID ID for an invalid FWDriver
  851.     kInvalidFWCommandObjectID    = 0,                    // zzz should use generic invalid ID
  852.     kInvalidFWCommandID            = 0,                    // zzz should use generic invalid ID
  853.     kInvalidFWIMCommandID        = 0,                    // zzz should use generic invalid ID
  854.     kInvalidFWClientCommandID    = 0,                    // zzz should use generic invalid ID
  855.     kInvalidFWIMProcessID        = 0,                    // zzz should use generic invalid ID
  856.     kInvalidIsochChannelID        = 0,                    // zzz should use generic invalid ID
  857.     kInvalidIsochPortID            = 0,                    // zzz should use generic invalid ID ID for an invalid FWIM
  858.     kInvalidDCLProgramID        = 0,                    // zzz should use generic invalid ID
  859.     kInvalidFWAddressSpaceID    = 0,                    // zzz should use generic invalid ID
  860.     kInvalidFWDeferredTaskID    = 0                        // zzz should use generic invalid ID
  861. };
  862.  
  863.  
  864. ////////////////////////////////////////////////////////////////////////////////
  865. //
  866. // FireWire deferred task defs.
  867. //
  868.  
  869. typedef void    (FWDeferredTaskProc) (
  870.     void                        *param1,
  871.     void                        *param2);
  872. typedef FWDeferredTaskProc        *FWDeferredTaskProcPtr;
  873.  
  874.  
  875. ////////////////////////////////////////////////////////////////////////////////
  876. //
  877. // Address space defs.
  878. //
  879.  
  880. enum
  881. {
  882.     kFWAddressWriteEnable            = kFWBit31,
  883.     kFWAddressWriteRequestNotify    = kFWBit30,
  884.     kFWAddressWriteCompleteNotify    = kFWBit29,
  885.     kFWAddressReadEnable            = kFWBit28,
  886.     kFWAddressReadRequestNotify        = kFWBit27,
  887.     kFWAddressReadCompleteNotify    = kFWBit26,
  888.     kFWAddressLockEnable            = kFWBit25,
  889.     kFWAddressLockRequestNotify        = kFWBit24,
  890.     kFWAddressLockCompleteNotify    = kFWBit23,
  891.     kFWAddressLocation                = FWBitRange (20, 22),
  892.     kFWAddressLocationPhase            = FWBitRangePhase (20, 22),
  893.     kFWAddressInitialMemorySpace        = 0,
  894.     kFWAddressPrivateSpace                = 1,
  895.     kFWAddressInitialUnitsSpace            = 2,
  896.     kFWAddressOffsetInitialUnitsSpace    = 3,
  897.     kFWAddressPhysical                    = 4,
  898.     kFWAddressSecondary                = kFWBit19,
  899.     kFWPCRAddressSpace                = kFWBit18
  900. };
  901.  
  902.  
  903. ////////////////////////////////////////////////////////////////////////////////
  904. //
  905. // Isochronous channel defs.
  906. //
  907.  
  908. enum
  909. {
  910.     kFWIsochChannelUnknownCondition        = 0,
  911.     kFWIsochChannelNotEnoughBandwidth    = 1,
  912.     kFWIsochChannelChannelNotAvailable    = 2
  913. };
  914.  
  915. typedef OSStatus    (FWIsochChannelForceStopNotificationProc) (
  916.     IsochChannelID                isochChannelID,
  917.     UInt32                        stopCondition);
  918. typedef FWIsochChannelForceStopNotificationProc
  919.                                 *FWIsochChannelForceStopNotificationProcPtr;
  920.  
  921.  
  922. ////////////////////////////////////////////////////////////////////////////////
  923. //
  924. // Isochronous channel defs.
  925. //
  926.  
  927. enum
  928. {
  929.     kFWDCLImmediateEvent        = 0,
  930.     kFWDCLCycleEvent            = 1,
  931.     kFWDCLSyBitsEvent            = 2
  932. };
  933.  
  934. enum
  935. {
  936.     kFWDCLInvalidNotification    = 0,
  937.     kFWDCLUpdateNotification    = 1,
  938.     kFWDCLModifyNotification    = 2
  939. };
  940.  
  941. enum
  942. {
  943.     kFWDCLOpDynamicFlag            = (1 << 16),
  944.     kFWDCLOpVendorDefinedFlag    = (1 << 17),
  945.     kFWDCLOpFlagMask            = BitRange (16, 31),
  946.     kFWDCLOpFlagPhase            = BitRangePhase (16, 31)
  947. };
  948.  
  949. enum
  950. {
  951.     kDCLInvalidOp                = 0,
  952.     kDCLSendPacketStartOp        = 1,
  953.     kDCLSendPacketWithHeaderStartOp
  954.                                 = 2,
  955.     kDCLSendPacketOp            = 3,
  956.     kDCLSendBufferOp            = 4,
  957.     kDCLReceivePacketStartOp    = 5,
  958.     kDCLReceivePacketOp            = 6,
  959.     kDCLReceiveBufferOp            = 7,
  960.     kDCLCallProcOp                = 8,
  961.     kDCLLabelOp                    = 9,
  962.     kDCLJumpOp                    = 10,
  963.     kDCLSetTagSyncBitsOp        = 11,
  964.     kDCLUpdateDCLListOp            = 12,
  965.     kDCLTimeStampOp                = 13
  966. };
  967.  
  968. typedef struct DCLCommandStruct
  969.                                 DCLCommand,
  970.                                 *DCLCommandPtr;
  971.  
  972. struct DCLCommandStruct
  973. {
  974.     DCLCommandPtr                pNextDCLCommand;        // Next DCL command.
  975.     UInt32                        compilerData;            // Data for use by DCL compiler.
  976.     UInt32                        opcode;                    // DCL opcode.
  977.     UInt32                        operands[1];            // DCL operands.
  978. };
  979.  
  980. struct DCLTransferPacketStruct
  981. {
  982.     DCLCommandPtr                pNextDCLCommand;        // Next DCL command.
  983.     UInt32                        compilerData;            // Data for use by DCL compiler.
  984.     UInt32                        opcode;                    // DCL opcode.
  985.     Ptr                            buffer;                    // Packet buffer.
  986.     UInt32                        size;                    // Buffer size.
  987. };
  988. typedef struct DCLTransferPacketStruct
  989.                                 DCLTransferPacket,
  990.                                 *DCLTransferPacketPtr;
  991.  
  992. struct DCLTransferBufferStruct
  993. {
  994.     DCLCommandPtr                pNextDCLCommand;        // Next DCL command.
  995.     UInt32                        compilerData;            // Data for use by DCL compiler.
  996.     UInt32                        opcode;                    // DCL opcode.
  997.     Ptr                            buffer;                    // Buffer.
  998.     UInt32                        size;                    // Buffer size.
  999.     UInt16                        packetSize;                // Size of packets to send.
  1000.     UInt16                        reserved;
  1001.     UInt32                        bufferOffset;            // Current offset into buffer.
  1002. };
  1003. typedef struct DCLTransferBufferStruct
  1004.                                 DCLTransferBuffer,
  1005.                                 *DCLTransferBufferPtr;
  1006.  
  1007. typedef void    (DCLCallCommandProc) (
  1008.     DCLCommandPtr                pDCLCommand);
  1009. typedef DCLCallCommandProc        *DCLCallCommandProcPtr;
  1010.  
  1011. struct DCLCallProcStruct
  1012. {
  1013.     DCLCommandPtr                pNextDCLCommand;        // Next DCL command.
  1014.     UInt32                        compilerData;            // Data for use by DCL compiler.
  1015.     UInt32                        opcode;                    // DCL opcode.
  1016.     DCLCallCommandProcPtr        proc;                    // Procedure to call.
  1017.     UInt32                        procData;                // Data for use by called procedure.
  1018. };
  1019. typedef struct DCLCallProcStruct
  1020.                                 DCLCallProc,
  1021.                                 *DCLCallProcPtr;
  1022.  
  1023. struct DCLLabelStruct
  1024. {
  1025.     DCLCommandPtr                pNextDCLCommand;        // Next DCL command.
  1026.     UInt32                        compilerData;            // Data for use by DCL compiler.
  1027.     UInt32                        opcode;                    // DCL opcode.
  1028. };
  1029. typedef struct DCLLabelStruct
  1030.                                 DCLLabel,
  1031.                                 *DCLLabelPtr;
  1032.  
  1033. struct DCLJumpStruct
  1034. {
  1035.     DCLCommandPtr                pNextDCLCommand;        // Next DCL command.
  1036.     UInt32                        compilerData;            // Data for use by DCL compiler.
  1037.     UInt32                        opcode;                    // DCL opcode.
  1038.     DCLLabelPtr                    pJumpDCLLabel;            // DCL label to jump to.
  1039. };
  1040. typedef struct DCLJumpStruct
  1041.                                 DCLJump,
  1042.                                 *DCLJumpPtr;
  1043.  
  1044. struct DCLSetTagSyncBitsStruct
  1045. {
  1046.     DCLCommandPtr                pNextDCLCommand;        // Next DCL command.
  1047.     UInt32                        compilerData;            // Data for use by DCL compiler.
  1048.     UInt32                        opcode;                    // DCL opcode.
  1049.     UInt16                        tagBits;                // Tag bits for following packets.
  1050.     UInt16                        syncBits;                // Sync bits for following packets.
  1051. };
  1052. typedef struct DCLSetTagSyncBitsStruct
  1053.                                 DCLSetTagSyncBits,
  1054.                                 *DCLSetTagSyncBitsPtr;
  1055.  
  1056. struct DCLUpdateDCLListStruct
  1057. {
  1058.     DCLCommandPtr                pNextDCLCommand;        // Next DCL command.
  1059.     UInt32                        compilerData;            // Data for use by DCL compiler.
  1060.     UInt32                        opcode;                    // DCL opcode.
  1061.     DCLCommandPtr                *dclCommandList;        // List of DCL commands to update.
  1062.     UInt32                        numDCLCommands;            // Number of DCL commands in list.
  1063. };
  1064. typedef struct DCLUpdateDCLListStruct
  1065.                                 DCLUpdateDCLList,
  1066.                                 *DCLUpdateDCLListPtr;
  1067.  
  1068. struct DCLTimeStampStruct
  1069. {
  1070.     DCLCommandPtr                pNextDCLCommand;        // Next DCL command.
  1071.     UInt32                        compilerData;            // Data for use by DCL compiler.
  1072.     UInt32                        opcode;                    // DCL opcode.
  1073.     UInt32                        timeStamp;                // Time stamp.
  1074. };
  1075. typedef struct DCLTimeStampStruct
  1076.                                 DCLTimeStamp,
  1077.                                 *DCLTimeStampPtr;
  1078.  
  1079. typedef OSStatus    (DCLProgramStartProc) (
  1080.     DCLProgramID                dclProgramID);
  1081. typedef DCLProgramStartProc        *DCLProgramStartProcPtr;
  1082.  
  1083. typedef OSStatus    (DCLProgramStopProc) (
  1084.     DCLProgramID                dclProgramID);
  1085. typedef DCLProgramStopProc        *DCLProgramStopProcPtr;
  1086.  
  1087. typedef OSStatus    (DCLProgramReleaseProc) (
  1088.     DCLProgramID                dclProgramID);
  1089. typedef DCLProgramReleaseProc    *DCLProgramReleaseProcPtr;
  1090.  
  1091. typedef OSStatus    (DCLCompilerNotificationProc) (
  1092.     DCLProgramID                dclProgramID,
  1093.     UInt32                        notificationType,
  1094.     DCLCommandPtr                *dclCommandList,
  1095.     UInt32                        numDCLCommands);
  1096. typedef DCLCompilerNotificationProc
  1097.                                 *DCLCompilerNotificationProcPtr;
  1098.  
  1099.  
  1100. ////////////////////////////////////////////////////////////////////////////////
  1101. //
  1102. // Define some bus management constants.
  1103. //
  1104.  
  1105. enum
  1106. {
  1107.     kFWBusManagerArbitrationTimeoutDuration
  1108.                                 = 625 * durationMillisecond
  1109. };
  1110.  
  1111.  
  1112. ////////////////////////////////////////////////////////////////////////////////
  1113. //
  1114. // Define some bus characteristics.
  1115. //
  1116.  
  1117. enum
  1118. {
  1119.     kFWMaxBusses                = 1023,
  1120.     kFWMaxNodesPerBus            = 63,
  1121.     kFWMaxNodeHops                = 16
  1122. };
  1123.  
  1124.  
  1125. ////////////////////////////////////////////////////////////////////////////////
  1126. //
  1127. // Packet defs.
  1128. //
  1129.  
  1130. // Phy packet defs.
  1131.  
  1132. enum
  1133. {
  1134.     kFWPhyPacketID                = FWBitRange (0, 1),
  1135.     kFWPhyPacketIDPhase            = FWBitRangePhase (0, 1),
  1136.  
  1137.     kFWPhyPacketPhyID            = FWBitRange (2, 7),
  1138.     kFWPhyPacketPhyIDPhase        = FWBitRangePhase (2, 7)
  1139. };
  1140.  
  1141. enum
  1142. {
  1143.     kSelfIDPacketSize            = 8,//zzz add FW
  1144.     kMaxSelfIDPacketsPerNode    = 9//zzz add FW
  1145. };
  1146.  
  1147. enum
  1148. {
  1149.     kFWConfigurationPacketID    = 0,
  1150.     kFWLinkOnPacketID            = 1,
  1151.     kFWSelfIDPacketID            = 2
  1152. };
  1153.  
  1154. enum
  1155. {
  1156.     kFWPhyConfigurationR        = kFWBit8,
  1157.     kFWPhyConfigurationT        = kFWBit9,
  1158.     kFWPhyConfigurationGapCnt    = FWBitRange (10, 15),
  1159.     kFWPhyConfigurationGapCntPhase
  1160.                                 = FWBitRangePhase (10, 15)
  1161. };
  1162.  
  1163. enum
  1164. {
  1165.     kFWSelfIDPortStatusChild    = 3,
  1166.     kFWSelfIDPortStatusParent    = 2,
  1167.     kFWSelfIDPortStatusNotConnected    = 1,
  1168.     kFWSelfIDPortStatusNotPresent    = 0,
  1169.  
  1170.     kFWSelfIDNoPower            = 0,
  1171.     kFWSelfIDSelfPowered15W        = 1,
  1172.     kFWSelfIDSelfPowered30W        = 2,
  1173.     kFWSelfIDSelfPowered45W        = 3,
  1174.     kFWSelfIDBusPowered1W        = 4,
  1175.     kFWSelfIDBusPowered3W        = 5,
  1176.     kFWSelfIDBusPowered6W        = 6,
  1177.     kFWSelfIDBusPowered10W        = 7,
  1178.  
  1179.     kFWSelfIDPhyID                = kFWPhyPacketPhyID,//zzz do we need or want this?
  1180.     kFWSelfIDPhyIDPhase            = kFWPhyPacketPhyIDPhase,
  1181.     kFWSelfIDM                    = kFWBit31,
  1182.  
  1183.     kFWSelfID0L                    = kFWBit9,
  1184.     kFWSelfID0GapCnt            = FWBitRange (10, 15),
  1185.     kFWSelfID0GapCntPhase        = FWBitRangePhase (10, 15),
  1186.     kFWSelfID0SP                = FWBitRange (16, 17),
  1187.     kFWSelfID0SPPhase            = FWBitRangePhase (16, 17),
  1188.     kFWSelfID0Del                = FWBitRange (18, 19),
  1189.     kFWSelfID0DelPhase            = FWBitRangePhase (18, 19),
  1190.     kFWSelfID0C                    = kFWBit20,
  1191.     kFWSelfID0Pwr                = FWBitRange (21, 23),
  1192.     kFWSelfID0PwrPhase            = FWBitRangePhase (21, 23),
  1193.     kFWSelfID0P0                = FWBitRange (24, 25),
  1194.     kFWSelfID0P0Phase            = FWBitRangePhase (24, 25),
  1195.     kFWSelfID0P1                = FWBitRange (26, 27),
  1196.     kFWSelfID0P1Phase            = FWBitRangePhase (26, 27),
  1197.     kFWSelfID0P2                = FWBitRange (28, 29),
  1198.     kFWSelfID0P2Phase            = FWBitRangePhase (28, 29),
  1199.     kFWSelfID0I                    = kFWBit30,
  1200.  
  1201.     kFWSelfIDPacketType            = kFWBit8,
  1202.     kFWSelfIDNN                    = FWBitRange (9, 11),
  1203.     kFWSelfIDNNPhase            = FWBitRangePhase (9, 11),
  1204.     kFWSelfIDNPa                = FWBitRange (14, 15),
  1205.     kFWSelfIDNPaPhase            = FWBitRangePhase (14, 15),
  1206.     kFWSelfIDNPb                = FWBitRange (16, 17),
  1207.     kFWSelfIDNPbPhase            = FWBitRangePhase (16, 17),
  1208.     kFWSelfIDNPc                = FWBitRange (18, 19),
  1209.     kFWSelfIDNPcPhase            = FWBitRangePhase (18, 19),
  1210.     kFWSelfIDNPd                = FWBitRange (20, 21),
  1211.     kFWSelfIDNPdPhase            = FWBitRangePhase (20, 21),
  1212.     kFWSelfIDNPe                = FWBitRange (22, 23),
  1213.     kFWSelfIDNPePhase            = FWBitRangePhase (22, 23),
  1214.     kFWSelfIDNPf                = FWBitRange (24, 25),
  1215.     kFWSelfIDNPfPhase            = FWBitRangePhase (24, 25),
  1216.     kFWSelfIDNPg                = FWBitRange (26, 27),
  1217.     kFWSelfIDNPgPhase            = FWBitRangePhase (26, 27),
  1218.     kFWSelfIDNPh                = FWBitRange (28, 29),
  1219.     kFWSelfIDNPhPhase            = FWBitRangePhase (28, 29),
  1220.     kFWSelfIDMore                = kFWBit31
  1221. };
  1222.  
  1223. // Primary packet defs.
  1224.  
  1225. enum
  1226. {
  1227.     kFWSpeed100MBit                = 0,
  1228.     kFWSpeed200MBit                = 1,
  1229.     kFWSpeed400MBit                = 2,
  1230.     kFWSpeedMaximum                = 0x7FFFFFFF,            //zzz what are the best numbers???
  1231.     kFWSpeedInvalid                = 0x80000000
  1232. };
  1233.  
  1234. enum
  1235. {
  1236.     kFWTCodeWriteQuadlet        = 0,
  1237.     kFWTCodeWriteBlock            = 1,
  1238.     kFWTCodeWriteResponse        = 2,
  1239.     kFWTCodeReadQuadlet            = 4,
  1240.     kFWTCodeReadBlock            = 5,
  1241.     kFWTCodeReadQuadletResponse    = 6,
  1242.     kFWTCodeReadBlockResponse    = 7,
  1243.     kFWTCodeCycleStart            = 8,
  1244.     kFWTCodeLock                = 9,
  1245.     kFWTCodeIsochronousBlock    = 10,
  1246.     kFWTCodeLockResponse        = 11,
  1247.     kFWTCodePHYPacket            = 14
  1248. };
  1249.  
  1250. enum
  1251. {
  1252.     kFWExtendedTCodeMaskSwap    = 1,
  1253.     kFWExtendedTCodeCompareSwap    = 2,
  1254.     kFWExtendedTCodeFetchAdd    = 3,
  1255.     kFWExtendedTCodeLittleAdd    = 4,
  1256.     kFWExtendedTCodeBoundedAdd    = 5,
  1257.     kFWExtendedTCodeWrapAdd        = 6,
  1258.     kFWExtendedTCodeVendorDependent    = 7
  1259. };
  1260.  
  1261. enum
  1262. {
  1263.     kFWResponseComplete            = 0,
  1264.     kFWResponseConflictError    = 4,
  1265.     kFWResponseDataError        = 5,
  1266.     kFWResponseTypeError        = 6,
  1267.     kFWResponseAddressError        = 7
  1268. };
  1269.  
  1270. enum
  1271. {
  1272.     kFWAckComplete                = 1,
  1273.     kFWAckPending                = 2,
  1274.     kFWAckBusyX                    = 4,
  1275.     kFWAckBusyA                    = 5,
  1276.     kFWAckBusyB                    = 6,
  1277.     kFWAckDataError                = 13,
  1278.     kFWAckTypeError                = 14
  1279. };
  1280.  
  1281.  
  1282. enum
  1283. {
  1284.     kFWIsochDataLength            = FWBitRange (0, 15),
  1285.     kFWIsochDataLengthPhase        = FWBitRangePhase (0, 15),
  1286.     
  1287.     kFWIsochTag                    = FWBitRange (16, 17),
  1288.     kFWIsochTagPhase            = FWBitRangePhase (16, 17),
  1289.  
  1290.     kFWIsochChanNum                = FWBitRange (18, 23),
  1291.     kFWIsochChanNumPhase        = FWBitRangePhase (18, 23),
  1292.  
  1293.     kFWIsochTCode                = FWBitRange (24, 27),
  1294.     kFWIsochTCodePhase            = FWBitRangePhase (24, 27),
  1295.  
  1296.     kFWIsochSy                    = FWBitRange (28, 31),
  1297.     kFWIsochSyPhase                = FWBitRangePhase (28, 31)
  1298. };
  1299.  
  1300.  
  1301. // Topology map.
  1302.  
  1303. enum
  1304. {
  1305.     kFWTopologyMapMaxSelfIDs    = kFWMaxNodesPerBus * kMaxSelfIDPacketsPerNode
  1306. };
  1307.  
  1308. struct FWTopologyMapStruct
  1309. {
  1310.     UInt16                        length;
  1311.     UInt16                        CRC;
  1312.     UInt32                        generationNumber;
  1313.     UInt16                        nodeCount;
  1314.     UInt16                        selfIDCount;
  1315.     UInt32                        selfIDs[kFWTopologyMapMaxSelfIDs];
  1316. };
  1317. typedef struct FWTopologyMapStruct
  1318.                                 FWTopologyMap,
  1319.                                 *FWTopologyMapPtr;
  1320.  
  1321. // Speed map.
  1322.  
  1323. enum
  1324. {
  1325.     kFWSpeedMapMaxSpeedCodes    = (kFWMaxNodesPerBus + 1) * (kFWMaxNodesPerBus - 1) +
  1326.                                   (kFWMaxNodesPerBus - 1)
  1327. };
  1328.  
  1329. struct FWSpeedMapStruct
  1330. {
  1331.     UInt16                        length;
  1332.     UInt16                        CRC;
  1333.     UInt32                        generationNumber;
  1334.     UInt8                        speedCodes[kFWSpeedMapMaxSpeedCodes];
  1335. };
  1336. typedef struct FWSpeedMapStruct    FWSpeedMap,
  1337.                                 *FWSpeedMapPtr;
  1338.  
  1339. ////////////////////////////////////////////////////////////////////////////////
  1340. //
  1341. // FireWire client defs.
  1342. //
  1343.  
  1344. enum
  1345. {
  1346.     kFWClientCommandQueueActiveBit    = 0,
  1347.     kFWClientCommandQueueActiveByte    = 1,
  1348.     kFWClientCommandQueueActive        = (1 << kFWClientCommandQueueActiveBit)
  1349. };
  1350.  
  1351. enum
  1352. {
  1353.     kFWClientCommandBusy        = 1,
  1354.     kFWClientCommandWaiting        = 2
  1355. };
  1356.  
  1357. enum
  1358. {
  1359.     kFWClientCommandSyncFlag    = (1 << 0),
  1360.     kFWClientCommandImmediateFlag    = (1 << 1)
  1361. };
  1362.  
  1363. enum
  1364. {
  1365.     kFWClientCommandAcceptNoMore
  1366.                                 = 0,
  1367.     kFWClientCommandAcceptMore    = 1,
  1368.     kFWClientCommandRejected    = 2
  1369. };
  1370.  
  1371. enum
  1372. {
  1373.     kFWClientResetNotify        = 1,                    // Notify client that a reset occured.
  1374.     kFWClientBusManagementNotify    = 2,                // Notify client that a reset occured and bus management has been established.
  1375.     kFWClientReadRequest        = 3,                    // Read request from client's address space.
  1376.     kFWClientReadComplete        = 4,                    // Read complete from client's address space.
  1377.     kFWClientWriteRequest        = 5,                    // Write request to a client's address space.
  1378.     kFWClientWriteComplete        = 6,                    // Write complete to a client's address space.
  1379.     kFWClientLockRequest        = 7,                    // Lock request to a client's address space.
  1380.     kFWClientLockComplete        = 8,                    // Lock complete to a client's address space.
  1381.     kFWClientInitIsochPort        = 9,                    // Initialize an isochronous port.
  1382.     kFWClientReleaseIsochPort    = 10,                    // Release resources allocated for isochronous port.
  1383.     kFWClientStartIsochPort        = 11,                    // Start data flow through isoch port.
  1384.     kFWClientStopIsochPort        = 12,                    // Stop data flow through isoch port.
  1385.     kFWClientSBP2LoginNotify    = 13,                    // Login-related notification
  1386.     kFWClientSBP2StatusNotify    = 14,                    // ORB-related notification
  1387.     kFWClientSBP2UnsolicitedStatusNotify    = 15        // Unsolicited SBP-2 status
  1388. };
  1389.  
  1390.  
  1391. // Define FireWire Client command param structures.
  1392.  
  1393. typedef struct FWClientInterfaceParamsStruct
  1394.                                 FWClientInterfaceParams,
  1395.                                 *FWClientInterfaceParamsPtr;
  1396.  
  1397. typedef void    (FWClientCommandCompletionProc) (
  1398.     FWClientInterfaceParamsPtr    pFWClientInterfaceParams);
  1399. typedef FWClientCommandCompletionProc
  1400.                                 *FWClientCommandCompletionProcPtr;
  1401.  
  1402. struct FWClientInterfaceParamsStruct
  1403. {
  1404.     UInt32                        interfaceSelector;        // Selector indicating the type of request.
  1405.     FWReferenceID                fwReferenceID;            // Reference to target of command.
  1406.     FWClientCommandID            fwClientCommandID;        // ID for this command.
  1407.     UInt32                        fwClientSpecificData;    // Data specific to the FireWire client.
  1408. };
  1409.  
  1410. struct FWClientAsynchRequestParamsStruct
  1411. {
  1412.     FWClientInterfaceParams        fwClientInterfaceParams;    // Common set of interface params.
  1413.     UInt32                        generation;                // Generation number that request was received on.
  1414.     Ptr                            receiveBuffer;            // Pointer to buffer with receive data.
  1415.     Ptr                            transmitBuffer;            // Pointer to buffer with transmit data.
  1416.     UInt16                        sourceID;                // Node ID of source of the request.
  1417.     UInt16                        responseCode;            // Response code.
  1418.     UInt32                        offset;                    // Offset of request within target address space.
  1419.     UInt16                        length;                    // Length of request.
  1420.     UInt16                        extendedTCode;            // Extended transaction code.
  1421.     FWAddressSpaceID            fwAddressSpaceID;        // ID of the target address space.
  1422.     Ptr                            pAddressSpecificData;    // Pointer to data specific to the address space.
  1423.     UInt32                        speed;                    // Received speed, and speed to reply at.
  1424. };
  1425. typedef struct FWClientAsynchRequestParamsStruct
  1426.                                 FWClientAsynchRequestParams,
  1427.                                 *FWClientAsynchRequestParamsPtr;
  1428.  
  1429. struct FWClientIsochPortParamsStruct
  1430. {
  1431.     IsochChannelID                isochChannelID;            // Reference to the channel that this port belongs to.
  1432.     UInt32                        refCon;                    // Reference constant for specific port.
  1433.     Boolean                        portIsTalker;            // Boolean indicating that this channel is the talker.
  1434. };
  1435. typedef struct FWClientIsochPortParamsStruct
  1436.                                 FWClientIsochPortParams,
  1437.                                 *FWClientIsochPortParamsPtr;
  1438.  
  1439. struct FWClientInitIsochPortParamsStruct
  1440. {
  1441.     FWClientInterfaceParams        fwClientInterfaceParams;    // Common set of interface params.
  1442.     FWClientIsochPortParams        fwClientIsochPortParams;    // Params for all isoch port requests.
  1443.     UInt32                        channelNum;                // Channel number for port.
  1444.     UInt32                        supportedChannelNumHi,    // Channel numbers supported by port.
  1445.                                 supportedChannelNumLo;
  1446.     UInt32                        speed;                    // Speed of channel.
  1447.     Boolean                        trial;                    // Boolean indicating that this call is just a trial.
  1448. };
  1449. typedef struct FWClientInitIsochPortParamsStruct
  1450.                                 FWClientInitIsochPortParams,
  1451.                                 *FWClientInitIsochPortParamsPtr;
  1452.  
  1453. struct FWClientReleaseIsochPortParamsStruct
  1454. {
  1455.     FWClientInterfaceParams        fwClientInterfaceParams;    // Common set of interface params.
  1456.     FWClientIsochPortParams        fwClientIsochPortParams;    // Params for all isoch port requests.
  1457. };
  1458. typedef struct FWClientReleaseIsochPortParamsStruct
  1459.                                 FWClientReleaseIsochPortParams,
  1460.                                 *FWClientReleaseIsochPortParamsPtr;
  1461.  
  1462. struct FWClientIsochPortControlParamsStruct
  1463. {
  1464.     FWClientInterfaceParams        fwClientInterfaceParams;    // Common set of interface params.
  1465.     FWClientIsochPortParams        fwClientIsochPortParams;    // Params for all isoch port requests.
  1466. };
  1467. typedef struct FWClientIsochPortControlParamsStruct
  1468.                                 FWClientIsochPortControlParams,
  1469.                                 *FWClientIsochPortControlParamsPtr;
  1470.  
  1471. struct FWClientPowerNotifyParamsStruct
  1472. {
  1473.     FWClientInterfaceParams        fwClientInterfaceParams;    // Common set of interface params.
  1474.     FWCommandObjectID            fwCommandObjectID;            // Power command object ID
  1475.     UInt32                        notificationEvent;
  1476. };
  1477. typedef struct FWClientPowerNotifyParamsStruct
  1478.                                 FWClientPowerNotifyParams,
  1479.                                 *FWClientPowerNotifyParamsPtr;
  1480.  
  1481.  
  1482. // Define FireWire Client procs.
  1483.  
  1484. typedef OSStatus    (FWClientInterfaceProc) (
  1485.     FWClientInterfaceParamsPtr    pFWClientInterfaceParams,
  1486.     UInt32                        *pCommandAcceptance);
  1487. typedef FWClientInterfaceProc    *FWClientInterfaceProcPtr;
  1488.  
  1489. typedef FWClientInterfaceProc    FWClientResetNotifyProc,
  1490.                                 *FWClientResetNotifyProcPtr;
  1491.  
  1492. typedef OSStatus    (FWClientReadProc) (
  1493.     FWClientAsynchRequestParamsPtr
  1494.                                 pAsynchRequestParams,
  1495.     UInt32                        *pCommandAcceptance);
  1496. typedef FWClientReadProc        *FWClientReadProcPtr;
  1497.  
  1498. typedef OSStatus    (FWClientWriteProc) (
  1499.     FWClientAsynchRequestParamsPtr
  1500.                                 pAsynchRequestParams,
  1501.     UInt32                        *pCommandAcceptance);
  1502. typedef FWClientWriteProc        *FWClientWriteProcPtr;
  1503.  
  1504. typedef OSStatus    (FWClientLockProc) (
  1505.     FWClientAsynchRequestParamsPtr
  1506.                                 pAsynchRequestParams,
  1507.     UInt32                        *pCommandAcceptance);
  1508. typedef FWClientLockProc        *FWClientLockProcPtr;
  1509.  
  1510. typedef OSStatus    (FWClientInitIsochPortProc) (
  1511.     FWClientInitIsochPortParamsPtr
  1512.                                 pInitIsochPortParams,
  1513.     UInt32                        *pCommandAcceptance);
  1514. typedef FWClientInitIsochPortProc
  1515.                                 *FWClientInitIsochPortProcPtr;
  1516.  
  1517. typedef OSStatus    (FWClientReleaseIsochPortProc) (
  1518.     FWClientReleaseIsochPortParamsPtr
  1519.                                 pReleaseIsochPortParams,
  1520.     UInt32                        *pCommandAcceptance);
  1521. typedef FWClientReleaseIsochPortProc
  1522.                                 *FWClientReleaseIsochPortProcPtr;
  1523.  
  1524. typedef OSStatus    (FWClientStartIsochPortProc) (
  1525.     FWClientIsochPortControlParamsPtr
  1526.                                 pIsochPortControlParams,
  1527.     UInt32                        *pCommandAcceptance);
  1528. typedef FWClientStartIsochPortProc
  1529.                                 *FWClientStartIsochPortProcPtr;
  1530.  
  1531. typedef OSStatus    (FWClientStopIsochPortProc) (
  1532.     FWClientIsochPortControlParamsPtr
  1533.                                 pIsochPortControlParams,
  1534.     UInt32                        *pCommandAcceptance);
  1535. typedef FWClientStopIsochPortProc
  1536.                                 *FWClientStopIsochPortProcPtr;
  1537.  
  1538. typedef OSStatus    (FWClientPowerNotifyProc) (
  1539.     FWClientPowerNotifyParamsPtr
  1540.                                 pPowerNotifyParams,
  1541.     UInt32                        *pCommandAcceptance);
  1542. typedef FWClientPowerNotifyProc    *FWClientPowerNotifyProcPtr;
  1543.  
  1544.  
  1545. ////////////////////////////////////////////////////////////////////////////////
  1546. //
  1547. // Gestalt defs - JKL: need to go into MasterInterfaces Gestalt.i
  1548. //
  1549.  
  1550. enum {
  1551.     gestaltFireWireVersion        = 'fwve',        // FireWire version
  1552.     kFireWireVersion            = 0x0201,        // current SDK version is 2.1
  1553.     gestaltFireWireAttr            = 'fwat',        // FireWire attributes
  1554.     gestaltHasFireWirePorts        = 0x00000001    // bit 0 set to 1 if FireWire hardware is detected
  1555. };
  1556.  
  1557. ////////////////////////////////////////////////////////////////////////////////
  1558. //
  1559. // FWIM defs.
  1560. //
  1561.  
  1562. // Define FWIM command types.
  1563.  
  1564. enum
  1565. {
  1566.     kFWIMSendLinkOnPacket
  1567.                                 = 1,                    // Send a phy configuration packet.
  1568.     kFWIMSendPhyConfigurationPacket
  1569.                                 = 2,                    // Send a phy configuration packet.
  1570.     kFWIMRead                    = 3,                    // Perform a read transaction.
  1571.     kFWIMReadResponse            = 4,                    // Transmit a read response.
  1572.     kFWIMWrite                    = 5,                    // Perform a write transaction.
  1573.     kFWIMWriteResponse            = 6,                    // Transmit a write response.
  1574.     kFWIMLock                    = 7,                    // Perform a lock transaction.
  1575.     kFWIMLockResponse            = 8,                    // Transmit a lock response.
  1576.     kFWIMAllocateIsochPort        = 9,                    // Allocate an isochronous port.
  1577.     kFWIMReleaseIsochPort        = 10,                    // Release resources allocated for an isochronous port.
  1578.     kFWIMStartIsochPort            = 11,                    // Start isochronous port.
  1579.     kFWIMStopIsochPort            = 12,                    // Stop isochronous port.
  1580.     kFWIMResetBus                = 13,                    // Reset the FireWire bus.
  1581.     kFWIMSetContenderBit        = 14,                    // Set the contender bit on the next bus reset.
  1582.     kFWIMClearContenderBit        = 15,                    // Clear the contender bit on the next bus reset.
  1583.     kFWIMEnableCycleMaster        = 16,                    // Enable cycle mastering.
  1584.     kFWIMDisableCycleMaster        = 17,                    // Disable cycle mastering.
  1585.     kFWIMSetRootHoldoffBit        = 18,                    // Set the root holdoff bit.
  1586.     kFWIMClearRootHoldoffBit    = 19,                    // Clear the root holdoff bit.
  1587.     kFWIMGetUniqueID            = 20,                    // Get the local unique ID.
  1588.     kFWIMSetCSRROM                = 21,                    // Set new CSR ROM data.
  1589.     kFWIMDoLocalCompareSwap        = 22,                    // Do a Compare/Swap (OpenHCI IRM only).
  1590.     kFWIMSetAsynchFilters        = 23,                    // Set asynch/physical filters.
  1591.     kFWIMSetFWIMState            = 24                    // Sleep/Wake/Quiesce FWIM for power saving or replacement.
  1592. };
  1593.  
  1594.  
  1595. // Defs for calls from the FWIM interface.
  1596.  
  1597. enum
  1598. {
  1599.     kFWIMProcessSelfIDs            = 1,
  1600.     kFWIMProcessRead            = 2,
  1601.     kFWIMProcessWrite            = 3,
  1602.     kFWIMProcessLock            = 4
  1603. };
  1604.  
  1605. // Defs for calls to the FWIM interface.
  1606. //zzz some of this stuff should be private
  1607.  
  1608. enum
  1609. {
  1610.     kFWIMCommandSyncFlag        = (1 << 0),                // Perform FWIM command synchronously.
  1611.     kFWIMCommandPriorityFlag    = (1 << 1),                // This is a priority command.
  1612.     kFWIMCommandImmediateFlag    = (1 << 2)                // Perform FWIM command immediately.
  1613. };
  1614.  
  1615. enum
  1616. {
  1617.     kFWIMCommandQueueActiveBit    = 0,
  1618.     kFWIMCommandQueueActiveByte    = 1,
  1619.     kFWIMCommandQueueActive        = (1 << kFWIMCommandQueueActiveBit),
  1620.  
  1621.     kFWIMCommandQueueDisabledBit    = 1,
  1622.     kFWIMCommandQueueDisabledByte    = 1,
  1623.     kFWIMCommandQueueDisabled        = (1 << kFWIMCommandQueueDisabledBit)
  1624. };
  1625.  
  1626. enum
  1627. {
  1628.     kFWIMCommandBusy            = 1
  1629. };
  1630.  
  1631. enum
  1632. {
  1633.     kFWIMCommandAcceptNoMore    = 0,
  1634.     kFWIMCommandAcceptMore        = 1,
  1635.     kFWIMCommandRejected        = 2
  1636. };
  1637.  
  1638. enum
  1639. {
  1640.     kFWIMFeatureCSRROMMap        = (1 << 0),                // Has CSR ROM mapping function
  1641.     kFWIMFeatureIRM                = (1 << 1),                // Has IRM registers in hardware
  1642.     kFWIMFeaturePhysicalDMA        = (1 << 2),                // Has some kind of Physical DMA
  1643.     kFWIMFeatureAsynchFilters    = (1 << 3),                // Has OHCI-style asynch/phys filters
  1644.     kFWIMFeatureSetFWIMState    = (1 << 4)                // Can be slept/quiesced
  1645. };
  1646.  
  1647. typedef struct FWIMCommandParamsStruct
  1648.                                 FWIMCommandParams,
  1649.                                 *FWIMCommandParamsPtr;
  1650.  
  1651. typedef void    (FWIMCommandCompletionProc) (
  1652.     FWIMCommandParamsPtr        pFWIMCommandParams);
  1653. typedef FWIMCommandCompletionProc
  1654.                                 *FWIMCommandCompletionProcPtr;
  1655.  
  1656. struct FWIMInitializeParamsStruct
  1657. {
  1658.     UInt32                        fwimSpecificData;        // Data specific to FWIM
  1659.     FWIMID                        fwimID;                    // ID for this FWIM
  1660.     RegEntryID                    fwimRegEntryID;            // Name registry entry for FireWire bus device
  1661.     UInt32                        fwimFeatures;            // Return area for FWIM features
  1662.     UInt32                        fwimCSRROMMapLength;    // Length of CSR ROM mapper, if available
  1663.     UInt32                        fwimDeciWatts;            // Deciwatts provided by hardware
  1664.     UInt32                        fwimDeciVoltsMinimum;    // Minimum decivolts at above load
  1665.     UInt32                        fwimDeciVoltsMaximum;    // Maximum decivolts at no load
  1666. };
  1667. typedef struct FWIMInitializeParamsStruct
  1668.                                 FWIMInitializeParams,
  1669.                                 *FWIMInitializeParamsPtr;
  1670.  
  1671. struct FWIMFinalizeParamsStruct
  1672. {
  1673.     UInt32                        fwimSpecificData;        // Data specific to FWIM
  1674.     FWIMID                        fwimID;                    // ID for this FWIM
  1675.     RegEntryID                    fwimRegEntryID;            // Name registry entry for FireWire bus device
  1676. };
  1677. typedef struct FWIMFinalizeParamsStruct
  1678.                                 FWIMFinalizeParams,
  1679.                                 *FWIMFinalizeParamsPtr;
  1680.  
  1681. struct FWIMPollInterruptsParamsStruct
  1682. {
  1683.     UInt32                        fwimSpecificData;        // Data specific to FWIM
  1684.     FWIMID                        fwimID;                    // ID for this FWIM
  1685. };
  1686. typedef struct FWIMPollInterruptsParamsStruct
  1687.                                 FWIMPollInterruptsParams,
  1688.                                 *FWIMPollInterruptsParamsPtr;
  1689.  
  1690. struct FWIMCommandParamsStruct
  1691. {
  1692.     UInt32                        commandType;            // Type of command.
  1693.     FWIMID                        fwimID;                    // Reference to target FWIM.
  1694.     UInt32                        fwimSpecificData;        // Data specific to FWIM.
  1695.     FWIMCommandID                fwimCommandID;            // ID for this command.
  1696. };
  1697.  
  1698. struct FWIMGetUniqueIDParamsStruct
  1699. {
  1700.     FWIMCommandParams            fwimCommandParams;        // Common command params.
  1701.     CSRNodeUniqueID                uniqueID;                // Local unique ID.
  1702. };
  1703. typedef struct FWIMGetUniqueIDParamsStruct
  1704.                                 FWIMGetUniqueIDParams,
  1705.                                 *FWIMGetUniqueIDParamsPtr;
  1706.  
  1707. struct FWIMSendPhyPacketParamsStruct
  1708. {
  1709.     FWIMCommandParams            fwimCommandParams;        // Common command params.
  1710.     UInt32                        generation;                // FireWire bus generation number.
  1711.     Ptr                            buffer;                    // Buffer with phy packet data.
  1712.     UInt32                        length;                    // Length of packet data.
  1713.     UInt32                        commandStorage;            // Most common phy packets only need 4 bytes.
  1714. };
  1715. typedef struct FWIMSendPhyPacketParamsStruct
  1716.                                 FWIMSendPhyPacketParams,
  1717.                                 *FWIMSendPhyPacketParamsPtr;
  1718.  
  1719. struct FWIMSetCSRROMParamsStruct
  1720. {
  1721.     FWIMCommandParams            fwimCommandParams;        // Common command params.
  1722.     Ptr                            pCSRROM;                // Buffer with ROM image.
  1723.     UInt32                        length;                    // Length of valid ROM image.
  1724.     UInt32                        *clearWhenDone;            // UInt32 for FWIM to clear when complete.
  1725. };
  1726. typedef struct FWIMSetCSRROMParamsStruct
  1727.                                 FWIMSetCSRROMParams,
  1728.                                 *FWIMSetCSRROMParamsPtr;
  1729.  
  1730. // These are registers implemented in hardware by OpenHCI:
  1731. enum
  1732. {
  1733.     kFW_OHCI_BUS_MANAGER_ID                = 0,
  1734.     kFW_OHCI_BANDWIDTH_AVAILABLE        = 1,
  1735.     kFW_OHCI_CHANNELS_AVAILABLE_HI        = 2,
  1736.     kFW_OHCI_CHANNELS_AVAILABLE_LO        = 3
  1737. };
  1738.  
  1739. struct FWIMCompareSwapParamsStruct
  1740. {
  1741.     FWIMCommandParams            fwimCommandParams;        // Common command params.
  1742.     UInt32                        targetRegister;            // from above enum
  1743.     UInt32                        oldValue;                // value we think it is
  1744.     UInt32                        newValue;                // value we want it to be
  1745.     UInt32                        returnValue;            // result
  1746. };
  1747. typedef struct FWIMCompareSwapParamsStruct
  1748.                                 FWIMCompareSwapParams,
  1749.                                 *FWIMCompareSwapParamsPtr;
  1750.  
  1751. struct FWIMSetAsynchFiltersParamsStruct
  1752. {
  1753.     FWIMCommandParams            fwimCommandParams;        // Common command params.
  1754.     UInt32                        asynchFilterHi;            // Asynchronous receive filter.
  1755.     UInt32                        asynchFilterLo;
  1756.     UInt32                        physicalFilterHi;        // Physical DMA filter.
  1757.     UInt32                        physicalFilterLo;
  1758.     // 2.1 and later FWIMs use this part:
  1759.     UInt32                        retryTableGeneration;    // For ack_data_err retries.
  1760.     UInt8                        *retryTable;
  1761. };
  1762. typedef struct FWIMSetAsynchFiltersParamsStruct
  1763.                                 FWIMSetAsynchFiltersParams,
  1764.                                 *FWIMSetAsynchFiltersParamsPtr;
  1765.  
  1766. struct FWIMSetFWIMStateParamsStruct
  1767. {
  1768.     FWIMCommandParams            fwimCommandParams;        // Common command params.
  1769.     UInt32                        fwimState;                // Active, standby, etc.
  1770. };
  1771. typedef struct FWIMSetFWIMStateParamsStruct
  1772.                                 FWIMSetFWIMStateParams,
  1773.                                 *FWIMSetFWIMStateParamsPtr;
  1774.  
  1775. struct FWIMAsynchCommandParamsStruct
  1776. {
  1777.     FWIMCommandParams            fwimCommandParams;        // Common command params.
  1778.     Duration                    timeout;                // Split transaction timeout.
  1779.     UInt32                        generation;                // FireWire bus generation number.
  1780.     Ptr                            buffer;                    // Local buffer to read/write into/from
  1781.     UInt8                        numRetries;                // Number of retries left.
  1782.     UInt8                        speed;                    // Transmission speed.
  1783.     UInt16                        reserved;
  1784.     UInt32                        addressHi,
  1785.                                 addressLo;                // FireWire bus address to read/write from/to
  1786.     UInt16                        length;                    // Length of read/write
  1787.     UInt16                        extendedTCode;            // Extended transaction code.
  1788. };
  1789. typedef struct FWIMAsynchCommandParamsStruct
  1790.                                 FWIMAsynchCommandParams,
  1791.                                 *FWIMAsynchCommandParamsPtr;
  1792.  
  1793. enum
  1794. {
  1795.     kFWTransactionDescriptorTLabel        = FWBitRange (16, 21),
  1796.     kFWTransactionDescriptorTLabelPhase    = FWBitRangePhase (16, 21)
  1797. };
  1798.  
  1799. enum //zzz need FWBitRange16
  1800. {
  1801.     kFWResponseDataRCode        = FWBitRange (16, 19),
  1802.     kFWResponseDataRCodePhase    = FWBitRangePhase (16, 19)
  1803. };
  1804.  
  1805. struct FWIMAsynchResponseCommandParamsStruct
  1806. {
  1807.     FWIMCommandParams            fwimCommandParams;        // Common command params.
  1808.     AbsoluteTime                timeout;                // Timeout for this response.
  1809.     UInt32                        generation;                // Topology map generation number this response is valid for.
  1810.     Ptr                            buffer;                    // Response buffer.
  1811.     UInt8                        numRetries;                // Number of retries left.
  1812.     UInt8                        speed;                    // Transmission speed.
  1813.     UInt16                        transactionDescriptor;    // Descriptor for transaction.
  1814.     UInt16                        destinationID;            // Destination node ID for this response.
  1815.     UInt16                        responseDataHi;            // Response data for transaction.
  1816.     UInt32                        responseDataLo;
  1817.     UInt16                        length;                    // Length of response data.
  1818.     UInt16                        extendedTCode;            // Extended transaction code for this response.
  1819. };
  1820. typedef struct FWIMAsynchResponseCommandParamsStruct
  1821.                                 FWIMAsynchResponseCommandParams,
  1822.                                 *FWIMAsynchResponseCommandParamsPtr;
  1823.  
  1824. struct FWIMIsochPortCommandParamsStruct
  1825. {
  1826.     IsochPortID                    isochPortID;            // Isochronous port ID.
  1827.     UInt32                        fwimIsochPortData;        // Data for FWIM to use for this isoch port.
  1828. };
  1829. typedef struct FWIMIsochPortCommandParamsStruct
  1830.                                 FWIMIsochPortCommandParams,
  1831.                                 *FWIMIsochPortCommandParamsPtr;
  1832.  
  1833. struct FWIMAllocateIsochPortParamsStruct
  1834. {
  1835.     FWIMCommandParams            fwimCommandParams;        // Common command params.
  1836.     FWIMIsochPortCommandParams    fwimIsochPortCommandParams;    // Common isoch port request params.
  1837.     DCLProgramID                dclProgramID;            // DCL program for this port.
  1838.     UInt32                        channelNum;                // Isochronous channel number.
  1839.     UInt32                        speed;                    // Speed to use for channel.
  1840.     Boolean                        talking;                // Buffer is for talking (listening if false).
  1841. };
  1842. typedef struct FWIMAllocateIsochPortParamsStruct
  1843.                                 FWIMAllocateIsochPortParams,
  1844.                                 *FWIMAllocateIsochPortParamsPtr;
  1845.  
  1846. struct FWIMReleaseIsochPortParamsStruct
  1847. {
  1848.     FWIMCommandParams            fwimCommandParams;        // Common command params.
  1849.     FWIMIsochPortCommandParams    fwimIsochPortCommandParams;    // Common isoch port request params.
  1850. };
  1851. typedef struct FWIMReleaseIsochPortParamsStruct
  1852.                                 FWIMReleaseIsochPortParams,
  1853.                                 *FWIMReleaseIsochPortParamsPtr;
  1854.  
  1855. struct FWIMIsochPortControlParamsStruct
  1856. {
  1857.     FWIMCommandParams            fwimCommandParams;        // Common command params.
  1858.     FWIMIsochPortCommandParams    fwimIsochPortCommandParams;    // Common isoch port request params.
  1859. };
  1860. typedef struct FWIMIsochPortControlParamsStruct
  1861.                                 FWIMIsochPortControlParams,
  1862.                                 *FWIMIsochPortControlParamsPtr;
  1863.  
  1864. //zzz pCycleTime didn't need to be by pointer return.  It's OK for the FWIM to
  1865. //directly modify fields in one of these param structs in order to return
  1866. //data to the caller.
  1867.  
  1868. struct FWIMGetCycleTimeParamsStruct
  1869. {
  1870.     FWIMCommandParams            fwimCommandParams;        // Common command params.
  1871.     UInt32                        *pCycleTime;            // return value.
  1872. };
  1873. typedef struct FWIMGetCycleTimeParamsStruct
  1874.                                 FWIMGetCycleTimeParams,
  1875.                                 *FWIMGetCycleTimeParamsPtr;
  1876.  
  1877. struct FWIMOptimizeParamsStruct
  1878. {
  1879.     FWIMCommandParams            fwimCommandParams;        // Common command params.
  1880.     UInt32                        bestSpeed;                // (<-) recommended by FWIM for asynch
  1881.     UInt32                        bestSize;                // (<-) recommended by FWIM for asynch
  1882.     Boolean                        forTransmit;            // (->) if not for receive...
  1883. };
  1884. typedef struct FWIMOptimizeParamsStruct
  1885.                                 FWIMOptimizeParams,
  1886.                                 *FWIMOptimizeParamsPtr;
  1887.  
  1888. // Define FWIM plug in dispatch table.
  1889.  
  1890. typedef OSStatus (FWIMInitializeProc) (
  1891.     FWIMInitializeParamsPtr        pFWIMInitializeParams);
  1892. typedef FWIMInitializeProc        *FWIMInitializeProcPtr;
  1893.  
  1894. typedef OSStatus (FWIMFinalizeProc) (
  1895.     FWIMFinalizeParamsPtr        pFWIMFinalizeParams);
  1896. typedef FWIMFinalizeProc        *FWIMFinalizeProcPtr;
  1897.  
  1898. typedef OSStatus (FWIMPollInterruptsProc) (
  1899.     FWIMPollInterruptsParamsPtr    pFWIMPollInterruptsParams);
  1900. typedef FWIMPollInterruptsProc    *FWIMPollInterruptsProcPtr;
  1901.  
  1902. typedef OSStatus (FWIMCommandProc) (
  1903.     FWIMCommandParamsPtr        pFWIMCommandParams,
  1904.     UInt32                        *pCommandAcceptance);
  1905. typedef FWIMCommandProc            *FWIMCommandProcPtr;
  1906.  
  1907. typedef OSStatus (FWIMSendPhyPacketProc) (
  1908.     FWIMSendPhyPacketParamsPtr    pFWIMSendPhyPacketParams,
  1909.     UInt32                        *pCommandAcceptance);
  1910. typedef FWIMSendPhyPacketProc    *FWIMSendPhyPacketProcPtr;
  1911.  
  1912. typedef OSStatus (FWIMAsynchTransactionProc) (
  1913.     FWIMAsynchCommandParamsPtr    pFWIMAsynchCommandParams,
  1914.     UInt32                        *pCommandAcceptance);
  1915. typedef FWIMAsynchTransactionProc
  1916.                                 *FWIMAsynchTransactionProcPtr;
  1917.  
  1918. typedef OSStatus (FWIMSendAsynchResponsePacketProc) (
  1919.     FWIMAsynchResponseCommandParamsPtr
  1920.                                 pFWIMAsynchResponseCommandParams,
  1921.     UInt32                        *pCommandAcceptance);
  1922. typedef FWIMSendAsynchResponsePacketProc
  1923.                                 *FWIMSendAsynchResponsePacketProcPtr;
  1924.  
  1925. typedef OSStatus (FWIMAllocateIsochPortProc) (
  1926.     FWIMAllocateIsochPortParamsPtr
  1927.                                 pFWIMAllocateIsochPortParams,
  1928.     UInt32                        *pCommandAcceptance);
  1929. typedef FWIMAllocateIsochPortProc
  1930.                                 *FWIMAllocateIsochPortProcPtr;
  1931.  
  1932. typedef OSStatus (FWIMReleaseIsochPortProc) (
  1933.     FWIMReleaseIsochPortParamsPtr
  1934.                                 pFWIMReleaseIsochPortParams,
  1935.     UInt32                        *pCommandAcceptance);
  1936. typedef FWIMReleaseIsochPortProc
  1937.                                 *FWIMReleaseIsochPortProcPtr;
  1938.  
  1939. typedef OSStatus (FWIMControlIsochPortProc) (
  1940.     FWIMIsochPortControlParamsPtr
  1941.                                 pFWIMIsochPortControlParams,
  1942.     UInt32                        *pCommandAcceptance);
  1943. typedef FWIMControlIsochPortProc
  1944.                                 *FWIMControlIsochPortProcPtr;
  1945.  
  1946. typedef OSStatus (FWIMGetUniqueIDProc) (
  1947.     FWIMGetUniqueIDParamsPtr    pFWIMGetUniqueIDParams,
  1948.     UInt32                        *pCommandAcceptance);
  1949. typedef FWIMGetUniqueIDProc        *FWIMGetUniqueIDProcPtr;
  1950.  
  1951. typedef OSStatus (FWIMSetCSRROMProc) (
  1952.     FWIMSetCSRROMParamsPtr        pFWIMSetCSRROMParams,
  1953.     UInt32                        *pCommandAcceptance);
  1954. typedef FWIMSetCSRROMProc    *FWIMSetCSRROMProcPtr;
  1955.  
  1956. typedef OSStatus (FWIMDoLocalCompareSwapProc) (
  1957.     FWIMCompareSwapParamsPtr        pFWIMCompareSwapParams);
  1958. typedef FWIMDoLocalCompareSwapProc    *FWIMDoLocalCompareSwapProcPtr;
  1959.  
  1960. typedef OSStatus (FWIMSetAsynchFiltersProc) (
  1961.     FWIMSetAsynchFiltersParamsPtr    pFWIMSetAsynchFiltersParams);
  1962. typedef FWIMSetAsynchFiltersProc    *FWIMSetAsynchFiltersProcPtr;
  1963.  
  1964. typedef OSStatus (FWIMSetFWIMStateProc) (
  1965.     FWIMSetFWIMStateParamsPtr    pFWIMSetFWIMStateParams);
  1966. typedef FWIMSetFWIMStateProc    *FWIMSetFWIMStateProcPtr;
  1967.  
  1968. typedef OSStatus (FWIMGetCycleTimeProc) (
  1969.     FWIMGetCycleTimeParamsPtr    pFWIMGetCycleTimeParams);
  1970. typedef FWIMGetCycleTimeProc    *FWIMGetCycleTimeProcPtr;
  1971.  
  1972. typedef OSStatus (FWIMOptimizeProc) (
  1973.     FWIMOptimizeParamsPtr        pFWIMOptimizeParams);
  1974. typedef FWIMOptimizeProc        *FWIMOptimizeProcPtr;
  1975.  
  1976. // FWIM States. Pretty much the same values as from Driver Gestalt in Designing PCI Cards and Drivers.
  1977. // Why aren't these values in DriverGestalt.h?!?
  1978. // Quiesced means "thou shalt not call the FSL no matter what. This is important if we are in the process
  1979. // of replacing it. If a FWIM can't be quiesced but is in ROM we probably can't boot from it since we need to remove
  1980. // the FWIM while replacing the FSL. If we get a page fault after that - well that's bad right?
  1981. // If the FWIM is successfully put to sleep with a kFWIMSleep request then the FWIM should not assume that
  1982. // its hardware is in a known state when waking back up again. The FWIM should completely re-initialize itself.
  1983. enum
  1984. {
  1985.     kFWIMActive                    = 0,                // Normal FWIM operating mode. Not Quiesced
  1986.     kFWIMStandby                = 1,                // Minimal energy saving, active in 5 sec. Not Quiesced
  1987.     kFWIMIdle                    = 2,                // Substantial energy saving, active in 15 sec. Quiesced.
  1988.     kFWIMSleep                    = 3                    // Maximum savings, system hardware may be subsequently turned off, Quiesced.
  1989. };
  1990.  
  1991. enum
  1992. {
  1993.     kFWIMPluginVersion            = 0x00010000,        // For FSL 1.0-style FWIMs
  1994.     kFWIMPluginVersion11        = 0x00010001,        // FWIM supports SetCSRROM, LocalCS, filters,
  1995.                                                     // etc., & returns feature info upon install.
  1996.                                                     // For use with FireWire Support 1.1 and later.
  1997.     kFWIMPluginVersion21        = 0x00020001        // FWIM supports OptimizeProc
  1998.                                                     // For use with FireWire Support 2.1 and later.
  1999. };
  2000.  
  2001. // This table must be extended only at the end.  No entries may ever be deleted.
  2002.  
  2003. struct FWIMPluginDispatchTableStruct
  2004. {
  2005.     UInt32                        pluginVersion;
  2006.     FWIMInitializeProcPtr        fwimInitializeProc;        // Proc that initializes the FWIM.
  2007.     FWIMFinalizeProcPtr            fwimFinalizeProc;        // Proc that finalizes the FWIM.
  2008.     FWIMPollInterruptsProcPtr    fwimPollInterruptsProc;    // Proc that polls for interrupts.
  2009.     FWIMSendPhyPacketProcPtr    fwimSendLinkOnPacketProc;    // Proc that sends a link on packet.
  2010.     FWIMSendPhyPacketProcPtr    fwimSendPhyConfigurationPacketProc;    // Proc that sends a phy configuration packet.
  2011.     FWIMAsynchTransactionProcPtr
  2012.                                 fwimReadProc;            // Proc that performs an asynchronous read transaction.
  2013.     FWIMSendAsynchResponsePacketProcPtr
  2014.                                 fwimReadResponseProc;    // Proc that sends an asynchronous read response packet.
  2015.     FWIMAsynchTransactionProcPtr
  2016.                                 fwimWriteProc;            // Proc that performs an asynchronous write transaction.
  2017.     FWIMSendAsynchResponsePacketProcPtr
  2018.                                 fwimWriteResponseProc;    // Proc that sends an asynchronous write response packet.
  2019.     FWIMAsynchTransactionProcPtr
  2020.                                 fwimLockProc;            // Proc that performs an asynchronous lock transaction.
  2021.     FWIMSendAsynchResponsePacketProcPtr
  2022.                                 fwimLockResponseProc;    // Proc that sends an asynchronous lock response packet.
  2023.     FWIMAllocateIsochPortProcPtr
  2024.                                 fwimAllocateIsochPortProc;    // Proc that allocates an isochronous port.
  2025.     FWIMReleaseIsochPortProcPtr    fwimReleaseIsochPortProc;    // Proc that releases an isochronous port.
  2026.     FWIMControlIsochPortProcPtr    fwimStartIsochPortProc;    // Proc that starts an isochronous port.
  2027.     FWIMControlIsochPortProcPtr    fwimStopIsochPortProc;    // Proc that stops an isochronous port.
  2028.     FWIMCommandProcPtr            fwimResetBusProc;        // Proc that initiates a FireWire bus reset.
  2029.     FWIMCommandProcPtr            fwimSetContenderBitProc;    // Proc that sets the contender bit.
  2030.     FWIMCommandProcPtr            fwimClearContenderBitProc;    // Proc that clears the contender bit.
  2031.     FWIMCommandProcPtr            fwimEnableCycleMasterProc;    // Proc that enables cycle mastering.
  2032.     FWIMCommandProcPtr            fwimDisableCycleMasterProc;    // Proc that disables cycle mastering.
  2033.     FWIMCommandProcPtr            fwimSetRootHoldoffBitProc;    // Proc that sets the root holdoff bit.
  2034.     FWIMCommandProcPtr            fwimClearRootHoldoffBitProc;    // Proc that clears the root holdoff bit.
  2035.     FWIMGetUniqueIDProcPtr        fwimGetUniqueIDProc;    // Proc that returns local unique ID.
  2036.     FWIMSetCSRROMProcPtr        fwimSetCSRROMProc;        // Proc that sets CSR ROM.
  2037.     FWIMDoLocalCompareSwapProcPtr    fwimDoLocalCompareSwapProc;    // Proc for hardware CS (OHCI IRM)
  2038.     FWIMSetAsynchFiltersProcPtr    fwimSetAsynchFiltersProc;    // Proc to set asynch and DMA filters
  2039.     FWIMSetFWIMStateProcPtr        fwimSetFWIMStateProc;    // Proc to put FWIM to sleep and/or quiesce it for replacement
  2040.     FWIMGetCycleTimeProcPtr        fwimGetCycleTimeProc;    // Proc to read cycle timer.
  2041.     FWIMOptimizeProcPtr            fwimOptimizeProc;        // Proc to set optimizations.
  2042. };
  2043. typedef struct FWIMPluginDispatchTableStruct
  2044.                                 FWIMPluginDispatchTable,
  2045.                                 *FWIMPluginDispatchTablePtr;
  2046.  
  2047. typedef struct FWIMProcessParamsStruct
  2048.                                 FWIMProcessParams,
  2049.                                 *FWIMProcessParamsPtr;
  2050.  
  2051. typedef void    (FWIMProcessCompletionProc) (
  2052.     FWIMProcessParamsPtr        pFWIMProcessParams);
  2053. typedef FWIMProcessCompletionProc
  2054.                                 *FWIMProcessCompletionProcPtr;
  2055.  
  2056. struct FWIMProcessParamsStruct
  2057. {
  2058.     FWIMProcessParamsPtr        pNextFWIMProcessParams;    // Link to next set of params.
  2059.     UInt32                        processType;            // Type of processing.
  2060.     FWIMID                        fwimID;                    // Reference to calling FWIM.
  2061.     UInt32                        processFlags;            // Flag bits to control processing.
  2062.     UInt32                        processState;            // State bits of processing.
  2063.     UInt32                        processStatus;            // Final status of processing.
  2064.     FWIMProcessID                fwimProcessID;            // ID for this process.
  2065.     FWIMProcessCompletionProcPtr
  2066.                                 completionProc;            // Proc to call upon completion of processing.
  2067.     UInt32                        completionProcData;        // Data provided and used by caller.
  2068. };
  2069.  
  2070. struct FWIMProcessSelfIDsParamsStruct
  2071. {
  2072.     FWIMProcessParams            fwimProcessParams;        // Common processing params.
  2073.     UInt32                        generation;                // Bus generation of these self IDs.
  2074.     Ptr                            pSelfIDList;            // List of self IDs.
  2075.     UInt32                        selfIDListSize;            // Size of above list in bytes.
  2076.     Ptr                            pLocalSelfID;            // Local self ID if not included in above list.
  2077.     UInt32                        localSelfIDSize;        // Size of local self ID.
  2078.     UInt32                        processSelfIDsFlags;    // Flags controlling self ID processing.
  2079. };
  2080. typedef struct FWIMProcessSelfIDsParamsStruct
  2081.                                 FWIMProcessSelfIDsParams,
  2082.                                 *FWIMProcessSelfIDsParamsPtr;
  2083.  
  2084. enum
  2085. {
  2086.     kFWTransactionStatusAckCode            = FWBitRange (28, 31),
  2087.     kFWTransactionStatusAckCodePhase    = FWBitRangePhase (28, 31),
  2088.     kFWTransactionStatusSpeed            = FWBitRange (26, 27),
  2089.     kFWTransactionStatusSpeedPhase        = FWBitRangePhase (26, 27)
  2090. };
  2091.  
  2092. struct FWIMProcessAsynchParamsStruct
  2093. {
  2094.     FWIMProcessParams            fwimProcessParams;        // Common processing params.
  2095.     AbsoluteTime                timeStamp;                // Time stamp marking arrival time of packet.
  2096.     UInt32                        generation;                // Topology map generation number when packet was received.
  2097.     Ptr                            receiveBuffer;            // Buffer for data that we receive.
  2098.     UInt16                        destinationID;            // ID of destination node.
  2099.     UInt16                        transactionDescriptor;    // Descriptor for transaction.
  2100.     UInt16                        sourceID;                // ID of source node.
  2101.     UInt16                        addressHi;                // Destination address.
  2102.     UInt32                        addressLo;
  2103.     UInt16                        length;                    // Length of transaction.
  2104.     UInt16                        extendedTCode;            // Extended transaction code.
  2105.     UInt32                        transactionStatus;        // Status of transaction.
  2106. };
  2107. typedef struct FWIMProcessAsynchParamsStruct
  2108.                                 FWIMProcessAsynchParams,
  2109.                                 *FWIMProcessAsynchParamsPtr;
  2110.  
  2111.  
  2112. ////////////////////////////////////////////////////////////////////////////////
  2113. //
  2114. // FireWire virtual device defs.
  2115. //
  2116.  
  2117. /*zzz should be in VirtualDevice.h */
  2118. //zzz support multiple bus vdev??? (FW and SCSI vdev?)
  2119. //
  2120.  
  2121. enum
  2122. {
  2123.     kVDeviceDescriptionSignature
  2124.                                 = 'vdei'                // Virtual Device Export Information
  2125. };
  2126.  
  2127. enum
  2128. {
  2129.     kVDeviceDescriptionVersion    = 0x00010000
  2130. };
  2131.  
  2132. struct VDeviceDescriptionStruct
  2133. {
  2134.     OSType                        vDeviceDescSignature;    // Virtual Device Description signature.
  2135.     UInt32                        vDeviceDescVersion;        // Virtual Device Description version.
  2136.     UInt32                        vDeviceDescSize;        // Total size of this description.
  2137.     OSType                        vDeviceServiceCategory;    // Service category of family providing interface to this
  2138.                                                         // virtual device.
  2139. };
  2140. typedef struct VDeviceDescriptionStruct
  2141.                                 VDeviceDescription,
  2142.                                 *VDeviceDescriptionPtr;
  2143.  
  2144. struct FWVDeviceDescriptionStruct
  2145. {
  2146.     VDeviceDescription            vDeviceDescription;        // Universal Virtual Device description.
  2147.     UInt32                        unitSpecID;                // Unit Spec ID to present in unit directory (24-bit).
  2148.     UInt32                        unitSWVersion;            // Unit SW version to present in unit directory (24-bit).
  2149. };
  2150. typedef struct FWVDeviceDescriptionStruct
  2151.                                 FWVDeviceDescription,
  2152.                                 *FWVDeviceDescriptionPtr;
  2153.  
  2154. /*zzz*/
  2155.  
  2156. // Define FW virtual device proc names.
  2157. #define FWVDeviceInstallProcPascalName "\pFWVDeviceInstall"
  2158. #define FWVDeviceInterfaceProcPascalName "\pFWVDeviceInterface"
  2159.  
  2160. struct FWVDeviceInstallParamsStruct
  2161. {
  2162.     Ptr                            fwVDeviceSpecificData;    // Data specific to virtual device.
  2163.     FWVDeviceID                    fwVDeviceID;            // ID for this virtual device.
  2164.     CSRROMEntryID                fwVDeviceCSRROMUnitDirID;    // ID of the virtual device's CSR ROM unit directory.
  2165. };
  2166. typedef struct FWVDeviceInstallParamsStruct
  2167.                                 FWVDeviceInstallParams,
  2168.                                 *FWVDeviceInstallParamsPtr;
  2169.  
  2170. typedef OSStatus
  2171.     (FWVDeviceInstallProc) (
  2172.         FWVDeviceInstallParamsPtr    pFWVDeviceInstallParams);
  2173. typedef FWVDeviceInstallProc    *FWVDeviceInstallProcPtr;
  2174.  
  2175.  
  2176. ////////////////////////////////////////////////////////////////////////////////
  2177. //
  2178. // FireWire protocol driver defs.
  2179. //
  2180.  
  2181. enum
  2182. {
  2183.     kFWPDriverFileType            = 'ndrv'
  2184. };
  2185.  
  2186. enum
  2187. {
  2188.     kTheFWPDriverDescriptionSignature
  2189.                                 = 'pdei'
  2190. };
  2191.  
  2192. enum
  2193. {
  2194.     kInitialFWPDriverDescriptor    = 0
  2195. };
  2196.  
  2197. typedef UInt32    FWPDriverDescVersion;
  2198. typedef OptionBits    FWPDriverLoadingOptions;
  2199.  
  2200. typedef OSStatus    (FWPDriverUnitAddedProc) (
  2201.     FWPDriverID                    fwPDriverID,
  2202.     UInt32                        fwPDriverSpecificData,
  2203.     FWUnitID                    fwUnitID);
  2204. typedef FWPDriverUnitAddedProc
  2205.                                 *FWPDriverUnitAddedProcPtr;
  2206.  
  2207. typedef OSStatus    (FWPDriverUnitRemovedProc) (
  2208.     FWPDriverID                    fwPDriverID,
  2209.     UInt32                        fwPDriverSpecificData,
  2210.     FWUnitID                    fwUnitID);
  2211. typedef FWPDriverUnitRemovedProc
  2212.                                 *FWPDriverUnitRemovedProcPtr;
  2213.  
  2214. struct FWPDriverProtocolStruct
  2215. {
  2216.     UInt32                        specID;                    // IDs specifying protocol.
  2217.     UInt32                        swVersion;
  2218. };
  2219. typedef struct FWPDriverProtocolStruct
  2220.                                 FWPDriverProtocol,
  2221.                                 *FWPDriverProtocolPtr;
  2222.  
  2223. struct FWPDriverTypeStruct
  2224. {
  2225.     OSType                        fwPDriverServiceCategory;    // Service category that this protocol driver communicates over.
  2226.     NumVersion                    fwPDriverVersion;            // Protocol driver version number.
  2227. };
  2228. typedef struct FWPDriverTypeStruct
  2229.                                 FWPDriverType,
  2230.                                 *FWPDriverTypePtr;
  2231.  
  2232. struct FWPDriverLoadingInfoStruct
  2233. {
  2234.     FWPDriverLoadingOptions        fwPDriverLoadingOptions;    // Options for protocol driver loading.
  2235.     Str31                        fwPDriverName;            // Protocol driver's name when loading into the Name Registry.
  2236. };
  2237. typedef struct FWPDriverLoadingInfoStruct
  2238.                                 FWPDriverLoadingInfo,
  2239.                                 *FWPDriverLoadingInfoPtr;
  2240.  
  2241. struct FWPDriverDescriptionStruct
  2242. {
  2243.     OSType                        fwPDriverDescSignature;    // Signature field of this structure.
  2244.     FWPDriverDescVersion        fwPDriverDescVersion;    // Version of this data structure.
  2245.     FWPDriverType                fwPDriverType;            // Type of protocol driver.
  2246.     FWPDriverLoadingInfo        fwPDriverLoadingInfo;    // Loading information for protocol driver.
  2247. };
  2248. typedef struct FWPDriverDescriptionStruct
  2249.                                 FWPDriverDescription,
  2250.                                 *FWPDriverDescriptionPtr;
  2251.  
  2252.  
  2253. ////////////////////////////////////////////////////////////////////////////////
  2254. //
  2255. // FireWire Services defs.
  2256. //
  2257.  
  2258. // FireWire Services constants.
  2259.  
  2260. enum
  2261. {
  2262.     kFWCommandWaiting            = 1,
  2263.     kFWCommandBusy                = 2,
  2264.     kFWCommandComplete            = 3
  2265. };
  2266.  
  2267. enum
  2268. {
  2269.     kFWCommandSyncFlag            = (1 << 0),                // Perform command synchronously.
  2270.     kFWCommandPriorityFlag        = (1 << 1),                // This is a priority command.
  2271.     kFWCommandSynchronizeFlag    = (1 << 2),                // Wait for this command to complete before starting
  2272.                                                         // subsequent commands.
  2273.     kFWCommandImmediateFlag        = (1 << 3)                // Perform command immediately.
  2274. };
  2275.  
  2276. enum
  2277. {
  2278.     kInvalidFWNodeID            = 0x7FFFFFFF,
  2279.     kInvalidFWGenerationNumber    = 0x7FFFFFFF
  2280. };
  2281.  
  2282. enum
  2283. {
  2284.     kIsochChannelActiveBit        = (1 << 0),                // Isochronous channel is active.
  2285.     kIsochChannelInitializedBit    = (1 << 1),                // Isochronous channel has been initialized.
  2286.     kIsochChannelBandwidthAllocatedBit    = (1 << 2),        // Bandwidth has been allocated for isochronous channel.
  2287.     kIsochChannelChannelAllocatedBit    = (1 << 3),        // Channel number has been allocated for isochronous channel.
  2288.     kIsochChannelAllocateOnResetBit        = (1 << 4)        // Resources must be reallocated on bus reset.
  2289. };
  2290.  
  2291. enum
  2292. {
  2293.     kInvalidFWChannelNum        = 0x7FFFFFFF
  2294. };
  2295.  
  2296.  
  2297. // Define FireWire service interface selectors.
  2298.  
  2299. enum
  2300. {
  2301.     kFWRead                        = 1,                    // Perform a read across the bus.
  2302.     kFWWrite                    = 2,                    // Perform a write across the bus.
  2303.     kFWCompareAndSwap            = 3,                    // Perform a write across the bus.
  2304.     kFWSendFCPCommand            = 4,                    // Send an FCP command and wait for response.
  2305.     kFWResetBus                    = 5,                    // Reset the FireWire bus.
  2306.     kFWBitAnd                    = 6,                    // Perform an atomic bitwise and.
  2307.     kFWBitOr                    = 7,                    // Perform an atomic bitwise or.
  2308.     kFWBitXor                    = 8,                    // Perform an atomic bitwise xor.
  2309.     kFWIncrement                = 9,                    // Perform an atomic increment.
  2310.     kFWDecrement                = 10,                    // Perform an atomic decrement.
  2311.     kFWAdd                        = 11,                    // Perform an atomic add.
  2312.     kFWThresholdAdd                = 12,                    // Perform an atomic threshold add.
  2313.     kFWThresholdSubtract        = 13,                    // Perform an atomic threshold subtract.
  2314.     kFWClippedAdd                = 14,                    // Perform an atomic clipped add.
  2315.     kFWClippedSubtract            = 15,                    // Perform an atomic clipped subtract.
  2316.     kFWInitializeIsochronousChannel    = 16,                // Initialize an isochronous channel.
  2317.     kFWReleaseIsochronousChannel    = 17,                // Release an isochronous channel.
  2318.     kFWStartIsochronousChannel        = 18,                // Start an isochronous channel.
  2319.     kFWStopIsochronousChannel        = 19,                // Stop an isochronous channel.
  2320.     kFWAllocateLocalIsochronousPort    = 20,                // Allocate a local isochronous port.
  2321.     kFWReleaseLocalIsochronousPort    = 21,                // Release a local isochronous port.
  2322.     kFWStartLocalIsochronousPort    = 22,                // Start a local isochronous port.
  2323.     kFWStopLocalIsochronousPort        = 23,                // Stop a local isochronous port.
  2324.     kFWSBP2Login                    = 24,                //   Serial Bus Protocol 2 API is
  2325.     kFWSBP2Logout                    = 25,                //   Just these four calls.
  2326.     kFWSBP2Append                    = 26,
  2327.     kFWSBP2Manage                    = 27,
  2328.     kFWChangePower                    = 28
  2329. };
  2330.  
  2331. enum
  2332. {
  2333.     kFWBasicCommandObjectType            = 1,            // Type of FireWire command object for basic commands.
  2334.     kFWAsynchCommandObjectType            = 2,            // Type of FireWire command object for asynchronous transaction commands.
  2335.     kFWIsochChannelCommandObjectType    = 3,            // Type of FireWire command object for isoch channel commands.
  2336.     kFWIsochPortCommandObjectType        = 4,            // Type of FireWire command object for isoch port commands.
  2337.     kFWFCPCommandObjectType                = 5,            // Type of FireWire command object for FCP commands.
  2338.     kFWSBP2LoginCommandObjectType        = 6,            // For SBP-2 logins
  2339.     kFWSBP2NormalCommandObjectType        = 7,            // For SBP-2 Normal Command ORBs
  2340.     kFWSBP2ManagementCommandObjectType    = 8,            // For SBP-2 miscellaneous
  2341.     kFWPowerCommandObjectType            = 9
  2342. };
  2343.  
  2344. // Flags for asynchronous command objects
  2345.  
  2346. enum
  2347. {
  2348.     kFWAsynchOverrideMaxPayload    = (1 << 0),                // Override max payload transfer flag.
  2349.     kFWAsynchDisableAddressIncrement
  2350.                                 = (1 << 1),                // Disable auto incrementing of target addresses.
  2351.     kFWAsynchAbsoluteAddress    = (1 << 2),                // Use full 64-bit address.
  2352.     kFWAsynchFailOnBusReset        = (1 << 3),                // Fail asynchronous command if a bus reset occurs.
  2353.     kFWAsynchOverrideSpeed        = (1 << 4)                // Use client-specified speed no matter what.
  2354. };
  2355.  
  2356. // Flags for power command objects
  2357.  
  2358. enum
  2359. {
  2360.     kFWImpossiblePowerRequest    = (1 << 0),                // Set by FWChangePower
  2361.     kFWCanReducePowerOnRequest    = (1 << 1),                // Driver willing to spin-down, etc.
  2362.     kFWNotifyWhenPowerAvailable    = (1 << 2)                // Driver willing to try again later
  2363. };
  2364.  
  2365. // Event codes for cable power notification events
  2366.  
  2367. enum
  2368. {
  2369.     kFWCablePowerMayBeAvailable    = 1,                    // Power requested earlier might be available
  2370.     kFWCablePowerDownRequest    = 2,                    // Please reduce consumption if possible
  2371.     kFWCablePowerOffRequest        = 3,                    // Please agree to zero power on bus
  2372.     kFWCablePowerOffNotify        = 4,                    // Power is going down - be ready or else
  2373.     kFWCablePowerFailNotify        = 5                        // Power was lost unexpectedly
  2374. };
  2375.  
  2376. // Flags for devices
  2377.  
  2378. enum
  2379. {
  2380.     kFWDeviceRetryOnAckDataErr    = (1 << 0),                // Device will accept retries on ack_data_err
  2381.     kFWDeviceDoNotEjectCardBus    = (1 << 1)                // Device can't recover if CardBus i/f ejected
  2382. };
  2383.  
  2384. // FireWire service request type defs.
  2385.  
  2386. typedef void    (FWCommandCompletionProc) (
  2387.     FWCommandObjectID            fwCommandObjectID,
  2388.     OSStatus                    commandStatus,
  2389.     UInt32                        completionProcData);
  2390. typedef FWCommandCompletionProc    *FWCommandCompletionProcPtr;
  2391.  
  2392. enum
  2393. {
  2394.     kResponseDoneStatus            = 0,
  2395.     kResponseContinueStatus        = 1,
  2396.     kResponseUnrecognizedStatus    = 2
  2397. };
  2398.  
  2399. typedef UInt32    (FCPResponseHandler) (
  2400.     FWCommandObjectID            fwCommandObjectID,
  2401.     Ptr                            responseBuffer,
  2402.     UInt32                        responseLength);
  2403. typedef FCPResponseHandler        *FCPResponseHandlerPtr;
  2404.  
  2405. struct FWAddressStruct
  2406. {
  2407.     UInt32                        addressHi,
  2408.                                 addressLo;
  2409. };
  2410. typedef struct FWAddressStruct    FWAddress, *FWAddressPtr;
  2411.  
  2412.  
  2413. // FireWire Services procedure defs.
  2414.  
  2415. OSStatus    FWRegisterDriver (
  2416.     RegEntryIDPtr                pFWDriverRegEntry,
  2417.     FWDriverID                    *pFWDriverID,
  2418.     CSRROMEntryID                *pCSRUnitID,
  2419.     UInt32                        fwDriverSpecificData);
  2420.  
  2421. OSStatus    FWUnregisterDriver (
  2422.     FWDriverID                    fwDriverID);
  2423.  
  2424. OSStatus    FWRegisterProtocolDriver (
  2425.     RegEntryIDPtr                pFWPDriverRegEntry,
  2426.     FWPDriverID                    *pFWPDriverID,
  2427.     UInt32                        fwPDriverSpecificData);
  2428.  
  2429. OSStatus    FWUnregisterProtocolDriver (
  2430.     FWPDriverID                    fwPDriverID);
  2431.  
  2432. OSStatus    FWScanUnitsForFWPDriver (
  2433.     FWPDriverID                    fwPDriverID);
  2434.  
  2435. OSStatus    FWSetPDriverProtocolTable (
  2436.     FWPDriverID                    fwPDriverID,
  2437.     FWPDriverProtocolPtr        fwPDriverProtocolTable,
  2438.     UInt32                        tableSize);
  2439.  
  2440. OSStatus    FWGetPDriverProtocolTable (
  2441.     FWPDriverID                    fwPDriverID,
  2442.     FWPDriverProtocolPtr        fwPDriverProtocolTable,
  2443.     UInt32                        *pTableSize,
  2444.     UInt32                        maxTableSize);
  2445.  
  2446. OSStatus    FWSetFWPDriverUnitAddedProc (
  2447.     FWPDriverID                    fwPDriverID,
  2448.     FWPDriverUnitAddedProcPtr    fwPDriverUnitAddedProc);
  2449.  
  2450. OSStatus    FWGetFWPDriverUnitAddedProc (
  2451.     FWPDriverID                    fwPDriverID,
  2452.     FWPDriverUnitAddedProcPtr    *pFWPDriverUnitAddedProc);
  2453.  
  2454. OSStatus    FWSetFWPDriverUnitRemovedProc (
  2455.     FWPDriverID                    fwPDriverID,
  2456.     FWPDriverUnitRemovedProcPtr    fwPDriverUnitRemovedProc);
  2457.  
  2458. OSStatus    FWGetFWPDriverUnitRemovedProc (
  2459.     FWPDriverID                    fwPDriverID,
  2460.     FWPDriverUnitRemovedProcPtr    *pFWPDriverUnitRemovedProc);
  2461.  
  2462. OSStatus    FWRegisterFSSpecPDriver (
  2463.     FSSpecPtr                    pFWPDriverFSSpec);
  2464.  
  2465. OSStatus    FWRegisterFSSpecResourcePDriver (
  2466.     FSSpecPtr                    pFWPDriverFSSpec,
  2467.     ResType                        fwPDriverResType,
  2468.     short                        fwPDriverResID);
  2469.  
  2470. OSStatus    FWAddUnitConnection (
  2471.     FWUnitID                    fwUnitID,
  2472.     FWReferenceID                fwReferenceID);
  2473.  
  2474. OSStatus    FWRemoveUnitConnection (
  2475.     FWUnitID                    fwUnitID,
  2476.     FWReferenceID                fwReferenceID);
  2477.  
  2478. OSStatus    FWSetFWClientResetNotifyProc (
  2479.     FWReferenceID                fwReferenceID,
  2480.     FWClientResetNotifyProcPtr    fwClientResetNotifyProc);
  2481.  
  2482. OSStatus    FWGetFWClientResetNotifyProc (
  2483.     FWReferenceID                fwReferenceID,
  2484.     FWClientResetNotifyProcPtr    *pFWClientResetNotifyProc);
  2485.  
  2486. OSStatus    FWSetFWClientBusManagementNotifyProc (
  2487.     FWReferenceID                fwReferenceID,
  2488.     FWClientResetNotifyProcPtr    fwClientResetNotifyProc);
  2489.  
  2490. OSStatus    FWGetFWClientBusManagementNotifyProc (
  2491.     FWReferenceID                fwReferenceID,
  2492.     FWClientResetNotifyProcPtr    *pFWClientResetNotifyProc);
  2493.  
  2494. OSStatus    FWSetFWClientReadRequestProc (
  2495.     FWReferenceID                fwReferenceID,
  2496.     FWClientReadProcPtr            fwClientReadRequestProc);
  2497.  
  2498. OSStatus    FWGetFWClientReadRequestProc (
  2499.     FWReferenceID                fwReferenceID,
  2500.     FWClientReadProcPtr            *pFWClientReadRequestProc);
  2501.  
  2502. OSStatus    FWSetFWClientReadCompleteProc (
  2503.     FWReferenceID                fwReferenceID,
  2504.     FWClientReadProcPtr            fwClientReadCompleteProc);
  2505.  
  2506. OSStatus    FWGetFWClientReadCompleteProc (
  2507.     FWReferenceID                fwReferenceID,
  2508.     FWClientReadProcPtr            *pFWClientReadCompleteProc);
  2509.  
  2510. OSStatus    FWSetFWClientWriteRequestProc (
  2511.     FWReferenceID                fwReferenceID,
  2512.     FWClientWriteProcPtr        fwClientWriteRequestProc);
  2513.  
  2514. OSStatus    FWGetFWClientWriteRequestProc (
  2515.     FWReferenceID                fwReferenceID,
  2516.     FWClientWriteProcPtr        *pFWClientWriteRequestProc);
  2517.  
  2518. OSStatus    FWSetFWClientWriteCompleteProc (
  2519.     FWReferenceID                fwReferenceID,
  2520.     FWClientWriteProcPtr        fwClientWriteCompleteProc);
  2521.  
  2522. OSStatus    FWGetFWClientWriteCompleteProc (
  2523.     FWReferenceID                fwReferenceID,
  2524.     FWClientWriteProcPtr        *pFWClientWriteCompleteProc);
  2525.  
  2526. OSStatus    FWSetFWClientLockRequestProc (
  2527.     FWReferenceID                fwReferenceID,
  2528.     FWClientLockProcPtr            fwClientLockRequestProc);
  2529.  
  2530. OSStatus    FWGetFWClientLockRequestProc (
  2531.     FWReferenceID                fwReferenceID,
  2532.     FWClientLockProcPtr            *pFWClientLockRequestProc);
  2533.  
  2534. OSStatus    FWSetFWClientLockCompleteProc (
  2535.     FWReferenceID                fwReferenceID,
  2536.     FWClientLockProcPtr            fwClientLockCompleteProc);
  2537.  
  2538. OSStatus    FWGetFWClientLockCompleteProc (
  2539.     FWReferenceID                fwReferenceID,
  2540.     FWClientLockProcPtr            *pFWClientLockCompleteProc);
  2541.  
  2542. OSStatus    FWSetFWClientInitIsochPortProc (
  2543.     FWReferenceID                fwReferenceID,
  2544.     FWClientInitIsochPortProcPtr
  2545.                                 fwClientInitIsochPortProc);
  2546.  
  2547. OSStatus    FWGetFWClientInitIsochPortProc (
  2548.     FWReferenceID                fwReferenceID,
  2549.     FWClientInitIsochPortProcPtr
  2550.                                 *pFWClientInitIsochPortProc);
  2551.  
  2552. OSStatus    FWSetFWClientReleaseIsochPortProc (
  2553.     FWReferenceID                fwReferenceID,
  2554.     FWClientReleaseIsochPortProcPtr
  2555.                                 fwClientReleaseIsochPortProc);
  2556.  
  2557. OSStatus    FWGetFWClientReleaseIsochPortProc (
  2558.     FWReferenceID                fwReferenceID,
  2559.     FWClientReleaseIsochPortProcPtr
  2560.                                 *pFWClientReleaseIsochPortProc);
  2561.  
  2562. OSStatus    FWSetFWClientStartIsochPortProc (
  2563.     FWReferenceID                fwReferenceID,
  2564.     FWClientStartIsochPortProcPtr
  2565.                                 fwClientStartIsochPortProc);
  2566.  
  2567. OSStatus    FWGetFWClientStartIsochPortProc (
  2568.     FWReferenceID                fwReferenceID,
  2569.     FWClientStartIsochPortProcPtr
  2570.                                 *pFWClientStartIsochPortProc);
  2571.  
  2572. OSStatus    FWSetFWClientStopIsochPortProc (
  2573.     FWReferenceID                fwReferenceID,
  2574.     FWClientStopIsochPortProcPtr
  2575.                                 fwClientStopIsochPortProc);
  2576.  
  2577. OSStatus    FWGetFWClientStopIsochPortProc (
  2578.     FWReferenceID                fwReferenceID,
  2579.     FWClientStopIsochPortProcPtr
  2580.                                 *pFWClientStopIsochPortProc);
  2581.  
  2582. OSStatus    FWSetFWClientPowerNotifyProc (
  2583.     FWReferenceID                fwReferenceID,
  2584.     FWClientPowerNotifyProcPtr    fwClientPowerNotifyProc);
  2585.  
  2586. OSStatus    FWGetFWClientPowerNotifyProc (
  2587.     FWReferenceID                fwReferenceID,
  2588.     FWClientPowerNotifyProcPtr    *pFWClientPowerNotifyProc);
  2589.  
  2590. TaskID    FWCurrentTaskID (void);
  2591.  
  2592. OSStatus    FWCreateSoftwareInterrupt (
  2593.     SoftwareInterruptHandler    theHandler,
  2594.     TaskID                        theTask,
  2595.     void                        *theParameter,
  2596.     Boolean                        persistent,
  2597.     SoftwareInterruptID            *theSoftwareInterrupt);
  2598.  
  2599. OSStatus    FWSendSoftwareInterrupt (
  2600.     SoftwareInterruptID            theSoftwareInterrupt,
  2601.     void                        *theParameter);
  2602.  
  2603. OSStatus    FWDeleteSoftwareInterrupt (
  2604.     SoftwareInterruptID            theSoftwareInterrupt);
  2605.  
  2606. OSStatus    FWAllocateFWCommandObject (
  2607.     FWCommandObjectID            *pFWCommandObjectID);
  2608.  
  2609. OSStatus    FWGetFWCommandObjectType (
  2610.     FWCommandObjectID            fwCommandObjectID,
  2611.     UInt32                        *pFWCommandObjectType);
  2612.  
  2613. OSStatus    FWGetFWCommandType (
  2614.     FWCommandObjectID            fwCommandObjectID,
  2615.     UInt32                        *pCommandType);
  2616.  
  2617. OSStatus    FWSetFWCommandFWReferenceID (
  2618.     FWCommandObjectID            fwCommandObjectID,
  2619.     FWReferenceID                fwReferenceID);
  2620.  
  2621. OSStatus    FWGetFWCommandFWReferenceID (
  2622.     FWCommandObjectID            fwCommandObjectID,
  2623.     FWReferenceID                *pFWReferenceID);
  2624.  
  2625. OSStatus    FWSetFWCommandFlags (
  2626.     FWCommandObjectID            fwCommandObjectID,
  2627.     UInt32                        commandFlags);
  2628.  
  2629. OSStatus    FWGetFWCommandFlags (
  2630.     FWCommandObjectID            fwCommandObjectID,
  2631.     UInt32                        *pCommandFlags);
  2632.  
  2633. OSStatus    FWGetFWCommandStatus (
  2634.     FWCommandObjectID            fwCommandObjectID,
  2635.     OSStatus                    *pCommandStatus);
  2636.  
  2637. OSStatus    FWSetFWCommandCompletionProc (
  2638.     FWCommandObjectID            fwCommandObjectID,
  2639.     FWCommandCompletionProcPtr    completionProc);
  2640.  
  2641. OSStatus    FWGetFWCommandCompletionProc (
  2642.     FWCommandObjectID            fwCommandObjectID,
  2643.     FWCommandCompletionProcPtr    *pCompletionProc);
  2644.  
  2645. OSStatus    FWSetFWCommandCompletionProcData (
  2646.     FWCommandObjectID            fwCommandObjectID,
  2647.     UInt32                        completionProcData);
  2648.  
  2649. OSStatus    FWGetFWCommandCompletionProcData (
  2650.     FWCommandObjectID            fwCommandObjectID,
  2651.     UInt32                        *pCompletionProcData);
  2652.  
  2653. OSStatus    FWSetFWCommandParams (
  2654.     FWCommandObjectID            fwCommandObjectID,
  2655.     FWReferenceID                fwReferenceID,
  2656.     UInt32                        commandFlags,
  2657.     FWCommandCompletionProcPtr    completionProc,
  2658.     UInt32                        completionProcData);
  2659.  
  2660. OSStatus    FWGetFWCommandParams (
  2661.     FWCommandObjectID            fwCommandObjectID,
  2662.     UInt32                        *pFWCommandObjectType,
  2663.     UInt32                        *pCommandType,
  2664.     FWReferenceID                *pFWReferenceID,
  2665.     UInt32                        *pCommandFlags,
  2666.     OSStatus                    *pCommandStatus,
  2667.     FWCommandCompletionProcPtr    *pCompletionProc,
  2668.     UInt32                        *pCompletionProcData);
  2669.  
  2670. OSStatus    FWDeallocateFWCommandObject (
  2671.     FWCommandObjectID            fwCommandObjectID);
  2672.  
  2673. OSStatus    FWGetTopologyMap (
  2674.     FWReferenceID                fwReferenceID,
  2675.     FWTopologyMapPtr            pFWTopologyMap);
  2676.  
  2677. OSStatus    FWAllocateAsynchCommandObject (
  2678.     FWCommandObjectID            *pFWCommandObjectID);
  2679.  
  2680. OSStatus    FWSetAsynchCommandGeneration (
  2681.     FWCommandObjectID            fwCommandObjectID,
  2682.     UInt32                        generation);
  2683.  
  2684. OSStatus    FWGetAsynchCommandGeneration (
  2685.     FWCommandObjectID            fwCommandObjectID,
  2686.     UInt32                        *pGeneration);
  2687.  
  2688. OSStatus    FWSetAsynchCommandAddress (
  2689.     FWCommandObjectID            fwCommandObjectID,
  2690.     UInt32                        addressHi,
  2691.     UInt32                        addressLo);
  2692.  
  2693. OSStatus    FWGetAsynchCommandAddress (
  2694.     FWCommandObjectID            fwCommandObjectID,
  2695.     UInt32                        *pAddressHi,
  2696.     UInt32                        *pAddressLo);
  2697.  
  2698. OSStatus    FWSetAsynchCommandBuffer (
  2699.     FWCommandObjectID            fwCommandObjectID,
  2700.     Ptr                            buffer);
  2701.  
  2702. OSStatus    FWGetAsynchCommandBuffer (
  2703.     FWCommandObjectID            fwCommandObjectID,
  2704.     Ptr                            *pBuffer);
  2705.  
  2706. OSStatus    FWSetAsynchCommandLength (
  2707.     FWCommandObjectID            fwCommandObjectID,
  2708.     UInt32                        length);
  2709.  
  2710. OSStatus    FWGetAsynchCommandLength (
  2711.     FWCommandObjectID            fwCommandObjectID,
  2712.     UInt32                        *pLength);
  2713.  
  2714. OSStatus    FWSetAsynchCommandBytesTransferred (
  2715.     FWCommandObjectID            fwCommandObjectID,
  2716.     UInt32                        bytesTransferred);
  2717.  
  2718. OSStatus    FWGetAsynchCommandBytesTransferred (
  2719.     FWCommandObjectID            fwCommandObjectID,
  2720.     UInt32                        *pBytesTransferred);
  2721.  
  2722. OSStatus    FWSetAsynchCommandMaxPayloadSize (
  2723.     FWCommandObjectID            fwCommandObjectID,
  2724.     UInt32                        maxPayloadSize);
  2725.  
  2726. OSStatus    FWGetAsynchCommandMaxPayloadSize (
  2727.     FWCommandObjectID            fwCommandObjectID,
  2728.     UInt32                        *pMaxPayloadSize);
  2729.  
  2730. OSStatus    FWSetAsynchCommandMaxRetries (
  2731.     FWCommandObjectID            fwCommandObjectID,
  2732.     UInt32                        maxRetries);
  2733.  
  2734. OSStatus    FWGetAsynchCommandMaxRetries (
  2735.     FWCommandObjectID            fwCommandObjectID,
  2736.     UInt32                        *pMaxRetries);
  2737.  
  2738. OSStatus    FWSetAsynchCommandTransferFlags (
  2739.     FWCommandObjectID            fwCommandObjectID,
  2740.     UInt32                        transferFlags);
  2741.  
  2742. OSStatus    FWGetAsynchCommandTransferFlags (
  2743.     FWCommandObjectID            fwCommandObjectID,
  2744.     UInt32                        *pTransferFlags);
  2745.  
  2746. OSStatus    FWSetAsynchCommandSpeed (
  2747.     FWCommandObjectID            fwCommandObjectID,
  2748.     UInt32                        speed);
  2749.  
  2750. OSStatus    FWGetAsynchCommandSpeed (
  2751.     FWCommandObjectID            fwCommandObjectID,
  2752.     UInt32                        *pSpeed);
  2753.  
  2754. OSStatus    FWSetAsynchCommandParams (
  2755.     FWCommandObjectID            fwCommandObjectID,
  2756.     UInt32                        generation,
  2757.     UInt32                        addressHi,
  2758.     UInt32                        addressLo,
  2759.     Ptr                            buffer,
  2760.     UInt32                        length,
  2761.     UInt32                        maxPayloadSize,
  2762.     UInt32                        maxRetries,
  2763.     UInt32                        transferFlags);
  2764.  
  2765. OSStatus    FWGetAsynchCommandParams (
  2766.     FWCommandObjectID            fwCommandObjectID,
  2767.     UInt32                        *pGeneration,
  2768.     UInt32                        *pAddressHi,
  2769.     UInt32                        *pAddressLo,
  2770.     Ptr                            *pBuffer,
  2771.     UInt32                        *pLength,
  2772.     UInt32                        *pBytesTransferred,
  2773.     UInt32                        *pMaxPayloadSize,
  2774.     UInt32                        *pMaxRetries,
  2775.     UInt32                        *pTransferFlags);
  2776.  
  2777. OSStatus    FWSetCommonAsynchCommandParams (
  2778.     FWCommandObjectID            fwCommandObjectID,
  2779.     UInt32                        addressHi,
  2780.     UInt32                        addressLo,
  2781.     Ptr                            buffer,
  2782.     UInt32                        length);
  2783.  
  2784. OSStatus    FWGetCommonAsynchCommandParams (
  2785.     FWCommandObjectID            fwCommandObjectID,
  2786.     Ptr                            *pBuffer,
  2787.     UInt32                        *pLength,
  2788.     UInt32                        *pBytesTransferred);
  2789.  
  2790. OSStatus    FWRead (
  2791.     FWCommandObjectID            fwCommandObjectID);
  2792.  
  2793. OSStatus    FWWrite (
  2794.     FWCommandObjectID            fwCommandObjectID);
  2795.  
  2796. OSStatus    FWCompareAndSwap (
  2797.     FWCommandObjectID            fwCommandObjectID);
  2798.  
  2799. OSStatus    FWBitAnd (
  2800.     FWCommandObjectID            fwCommandObjectID);
  2801.  
  2802. OSStatus    FWBitOr (
  2803.     FWCommandObjectID            fwCommandObjectID);
  2804.  
  2805. OSStatus    FWBitXor (
  2806.     FWCommandObjectID            fwCommandObjectID);
  2807.  
  2808. OSStatus    FWIncrement (
  2809.     FWCommandObjectID            fwCommandObjectID);
  2810.  
  2811. OSStatus    FWDecrement (
  2812.     FWCommandObjectID            fwCommandObjectID);
  2813.  
  2814. OSStatus    FWAdd (
  2815.     FWCommandObjectID            fwCommandObjectID);
  2816.  
  2817. OSStatus    FWThresholdAdd (
  2818.     FWCommandObjectID            fwCommandObjectID);
  2819.  
  2820. OSStatus    FWThresholdSubtract (
  2821.     FWCommandObjectID            fwCommandObjectID);
  2822.  
  2823. OSStatus    FWClippedAdd (
  2824.     FWCommandObjectID            fwCommandObjectID);
  2825.  
  2826. OSStatus    FWClippedSubtract (
  2827.     FWCommandObjectID            fwCommandObjectID);
  2828.  
  2829. OSStatus    FWSendFCPCommand (
  2830.     FWCommandObjectID            fwCommandObjectID);
  2831.  
  2832. OSStatus    FWAllocateFCPCommandObject (
  2833.     FWCommandObjectID            *pFWCommandObjectID);
  2834.  
  2835. OSStatus    FWSetFCPCommandCommandBuffer (
  2836.     FWCommandObjectID            fwCommandObjectID,
  2837.     Ptr                            commandBuffer);
  2838.  
  2839. OSStatus    FWGetFCPCommandCommandBuffer (
  2840.     FWCommandObjectID            fwCommandObjectID,
  2841.     Ptr                            *pCommandBuffer);
  2842.  
  2843. OSStatus    FWSetFCPCommandCommandLength (
  2844.     FWCommandObjectID            fwCommandObjectID,
  2845.     UInt32                        commandLength);
  2846.  
  2847. OSStatus    FWGetFCPCommandCommandLength (
  2848.     FWCommandObjectID            fwCommandObjectID,
  2849.     UInt32                        *pCommandLength);
  2850.  
  2851. OSStatus    FWSetFCPCommandResponseBuffer (
  2852.     FWCommandObjectID            fwCommandObjectID,
  2853.     Ptr                            responseBuffer);
  2854.  
  2855. OSStatus    FWGetFCPCommandResponseBuffer (
  2856.     FWCommandObjectID            fwCommandObjectID,
  2857.     Ptr                            *pResponseBuffer);
  2858.  
  2859. OSStatus    FWSetFCPCommandResponseBufferSize (
  2860.     FWCommandObjectID            fwCommandObjectID,
  2861.     UInt32                        responseBufferSize);
  2862.  
  2863. OSStatus    FWGetFCPCommandResponseBufferSize (
  2864.     FWCommandObjectID            fwCommandObjectID,
  2865.     UInt32                        *pResponseBufferSize);
  2866.  
  2867. OSStatus    FWSetFCPCommandResponseLength (
  2868.     FWCommandObjectID            fwCommandObjectID,
  2869.     UInt32                        responseLength);
  2870.  
  2871. OSStatus    FWGetFCPCommandResponseLength (
  2872.     FWCommandObjectID            fwCommandObjectID,
  2873.     UInt32                        *pResponseLength);
  2874.  
  2875. OSStatus    FWSetFCPCommandTimeout (
  2876.     FWCommandObjectID            fwCommandObjectID,
  2877.     Duration                    timeout);
  2878.  
  2879. OSStatus    FWGetFCPCommandTimeout (
  2880.     FWCommandObjectID            fwCommandObjectID,
  2881.     Duration                    *pTimeout);
  2882.  
  2883. OSStatus    FWSetFCPCommandMaxRetries (
  2884.     FWCommandObjectID            fwCommandObjectID,
  2885.     UInt32                        maxRetries);
  2886.  
  2887. OSStatus    FWGetFCPCommandMaxRetries (
  2888.     FWCommandObjectID            fwCommandObjectID,
  2889.     UInt32                        *pMaxRetries);
  2890.  
  2891. OSStatus    FWSetFCPCommandTransferFlags (
  2892.     FWCommandObjectID            fwCommandObjectID,
  2893.     UInt32                        transferFlags);
  2894.  
  2895. OSStatus    FWGetFCPCommandTransferFlags (
  2896.     FWCommandObjectID            fwCommandObjectID,
  2897.     UInt32                        *pTransferFlags);
  2898.  
  2899. OSStatus    FWSetFCPCommandResponseHandler (
  2900.     FWCommandObjectID            fwCommandObjectID,
  2901.     FCPResponseHandlerPtr        fcpResponseHandler);
  2902.  
  2903. OSStatus    FWGetFCPCommandResponseHandler (
  2904.     FWCommandObjectID            fwCommandObjectID,
  2905.     FCPResponseHandlerPtr        *pFCPResponseHandler);
  2906.  
  2907. OSStatus    FWSetFCPCommandParams (
  2908.     FWCommandObjectID            fwCommandObjectID,
  2909.     Ptr                            commandBuffer,
  2910.     UInt32                        commandLength,
  2911.     Ptr                            responseBuffer,
  2912.     UInt32                        responseBufferSize,
  2913.     Duration                    timeout,
  2914.     UInt32                        maxRetries,
  2915.     UInt32                        transferFlags,
  2916.     FCPResponseHandlerPtr        fcpResponseHandler);
  2917.  
  2918. OSStatus    FWGetFCPCommandParams (
  2919.     FWCommandObjectID            fwCommandObjectID,
  2920.     Ptr                            *pCommandBuffer,
  2921.     UInt32                        *pCommandLength,
  2922.     Ptr                            *pResponseBuffer,
  2923.     UInt32                        *pResponseBufferSize,
  2924.     UInt32                        *pResponseLength,
  2925.     Duration                    *pTimeout,
  2926.     UInt32                        *pMaxRetries,
  2927.     UInt32                        *pTransferFlags,
  2928.     FCPResponseHandlerPtr        *pFCPResponseHandler);
  2929.  
  2930. OSStatus    FWResetBus (
  2931.     FWCommandObjectID            fwCommandObjectID);
  2932.  
  2933. OSStatus    FWAllocateIsochronousChannelID (
  2934.     IsochChannelID                *pIsochChannelID,
  2935.     Boolean                        doIRMAllocation,
  2936.     UInt32                        bandwidth,
  2937.     UInt32                        preferredSpeed);
  2938.  
  2939. OSStatus    FWDeallocateIsochronousChannelID (
  2940.     IsochChannelID                isochChannelID);
  2941.  
  2942. OSStatus    FWAddIsochronousChannelClient (
  2943.     IsochChannelID                isochChannelID,
  2944.     FWReferenceID                fwReferenceID,
  2945.     UInt32                        refCon,
  2946.     Boolean                        clientIsTalker);
  2947.  
  2948. OSStatus    FWSetIsochChannelForceStopNotificationProc (
  2949.     IsochChannelID                isochChannelID,
  2950.     FWIsochChannelForceStopNotificationProcPtr
  2951.                                 fwIsochChannelForceStopNotificationProc);
  2952.  
  2953. OSStatus    FWInitializeIsochronousChannel (
  2954.     FWCommandObjectID            fwCommandObjectID);
  2955.  
  2956. OSStatus    FWReleaseIsochronousChannel (
  2957.     FWCommandObjectID            fwCommandObjectID);
  2958.  
  2959. OSStatus    FWStartIsochronousChannel (
  2960.     FWCommandObjectID            fwCommandObjectID);
  2961.  
  2962. OSStatus    FWStopIsochronousChannel (
  2963.     FWCommandObjectID            fwCommandObjectID);
  2964.  
  2965. OSStatus    FWAllocateIsochChannelCommandObject (
  2966.     FWCommandObjectID            *pFWCommandObjectID);
  2967.  
  2968. OSStatus    FWSetIsochChannelCommandIsochChannelID (
  2969.     FWCommandObjectID            fwCommandObjectID,
  2970.     IsochChannelID                isochChannelID);
  2971.  
  2972. OSStatus    FWGetIsochChannelCommandIsochChannelID (
  2973.     FWCommandObjectID            fwCommandObjectID,
  2974.     IsochChannelID                *pIsochChannelID);
  2975.  
  2976. OSStatus    FWCreateDCLProgram (
  2977.     DCLProgramID                *pDCLProgramID);
  2978.  
  2979. OSStatus    FWDisposeDCLProgram (
  2980.     DCLProgramID                dclProgramID);
  2981.  
  2982. OSStatus    FWSetDCLProgramStart (
  2983.     DCLProgramID                dclProgramID,
  2984.     DCLCommandPtr                pDCLStart);
  2985.  
  2986. OSStatus    FWGetDCLProgramStart (
  2987.     DCLProgramID                dclProgramID,
  2988.     DCLCommandPtr                *ppDCLStart);
  2989.  
  2990. OSStatus    FWSetDCLProgramEngineData (
  2991.     DCLProgramID                dclProgramID,
  2992.     UInt32                        dclEngineData);
  2993.  
  2994. OSStatus    FWGetDCLProgramEngineData (
  2995.     DCLProgramID                dclProgramID,
  2996.     UInt32                        *pDCLEngineData);
  2997.  
  2998. OSStatus    FWSetDCLProgramStartProc (
  2999.     DCLProgramID                dclProgramID,
  3000.     DCLProgramStartProcPtr        dclProgramStartProc);
  3001.  
  3002. OSStatus    FWGetDCLProgramStartProc (
  3003.     DCLProgramID                dclProgramID,
  3004.     DCLProgramStartProcPtr        *pDCLProgramStartProc);
  3005.  
  3006. OSStatus    FWSetDCLProgramStopProc (
  3007.     DCLProgramID                dclProgramID,
  3008.     DCLProgramStopProcPtr        dclProgramStopProc);
  3009.  
  3010. OSStatus    FWGetDCLProgramStopProc (
  3011.     DCLProgramID                dclProgramID,
  3012.     DCLProgramStopProcPtr        *pDCLProgramStopProc);
  3013.  
  3014. OSStatus    FWSetDCLProgramReleaseProc (
  3015.     DCLProgramID                dclProgramID,
  3016.     DCLProgramReleaseProcPtr    dclProgramReleaseProc);
  3017.  
  3018. OSStatus    FWGetDCLProgramReleaseProc (
  3019.     DCLProgramID                dclProgramID,
  3020.     DCLProgramReleaseProcPtr    *pDCLProgramReleaseProc);
  3021.  
  3022. OSStatus    FWSetDCLProgramCompilerNotificationProc (
  3023.     DCLProgramID                dclProgramID,
  3024.     DCLCompilerNotificationProcPtr
  3025.                                 dclCompilerNotificationProc);
  3026.  
  3027. OSStatus    FWGetDCLProgramCompilerNotificationProc (
  3028.     DCLProgramID                dclProgramID,
  3029.     DCLCompilerNotificationProcPtr
  3030.                                 *pDCLCompilerNotificationProc);
  3031.  
  3032. OSStatus    FWSetDCLProgramChannelNum (
  3033.     DCLProgramID                dclProgramID,
  3034.     UInt32                        channelNum);
  3035.  
  3036. OSStatus    FWGetDCLProgramChannelNum (
  3037.     DCLProgramID                dclProgramID,
  3038.     UInt32                        *pChannelNum);
  3039.  
  3040. OSStatus    FWSetDCLProgramTalking (
  3041.     DCLProgramID                dclProgramID,
  3042.     Boolean                        talking);
  3043.  
  3044. OSStatus    FWGetDCLProgramTalking (
  3045.     DCLProgramID                dclProgramID,
  3046.     Boolean                        *pTalking);
  3047.  
  3048. OSStatus    FWSetDCLProgramStartEvent (
  3049.     DCLProgramID                dclProgramID,
  3050.     UInt32                        startEvent,
  3051.     UInt32                        startEventState,
  3052.     UInt32                        startEventStateMask);
  3053.  
  3054. OSStatus    FWGetDCLProgramStartEvent (
  3055.     DCLProgramID                dclProgramID,
  3056.     UInt32                        *pStartEvent,
  3057.     UInt32                        *pStartEventState,
  3058.     UInt32                        *pStartEventStateMask);
  3059.  
  3060. OSStatus    FWTranslateDCLProgram (
  3061.     DCLProgramID                dclProgramID,
  3062.     DCLProgramID                *pTranslatedDCLProgramID);
  3063.  
  3064. OSStatus    FWStartDCLProgram (
  3065.     DCLProgramID                dclProgramID);
  3066.  
  3067. OSStatus    FWStopDCLProgram (
  3068.     DCLProgramID                dclProgramID);
  3069.  
  3070. OSStatus    FWReleaseDCLProgram (
  3071.     DCLProgramID                dclProgramID);
  3072.  
  3073. OSStatus    FWUpdateDCLList (
  3074.     DCLProgramID                dclProgramID,
  3075.     DCLCommandPtr                *dclCommandList,
  3076.     UInt32                        numDCLCommands);
  3077.  
  3078. OSStatus    FWModifyDCLList (
  3079.     DCLProgramID                dclProgramID,
  3080.     DCLCommandPtr                *dclCommandList,
  3081.     UInt32                        numDCLCommands);
  3082.  
  3083. OSStatus    FWModifyDCLJump (
  3084.     DCLProgramID                dclProgramID,
  3085.     DCLJumpPtr                    pDCLJump,
  3086.     DCLLabelPtr                    pDCLLabel);
  3087.  
  3088. OSStatus    FWCallDCLCallProc (
  3089.     DCLProgramID                dclProgramID,
  3090.     DCLCallProcPtr                pDCLCallProc);
  3091.  
  3092. OSStatus    FWAllocateIsochPortID (
  3093.     IsochPortID                    *pIsochPortID,
  3094.     DCLProgramID                dclProgramID,
  3095.     UInt32                        channelNum,
  3096.     UInt32                        speed,
  3097.     Boolean                        talking);
  3098.  
  3099. OSStatus    FWDeallocateIsochPortID (
  3100.     IsochPortID                    isochPortID);
  3101.  
  3102. OSStatus    FWAllocateLocalIsochronousPort (
  3103.     FWCommandObjectID            fwCommandObjectID);
  3104.  
  3105. OSStatus    FWReleaseLocalIsochronousPort (
  3106.     FWCommandObjectID            fwCommandObjectID);
  3107.  
  3108. OSStatus    FWStartLocalIsochronousPort (
  3109.     FWCommandObjectID            fwCommandObjectID);
  3110.  
  3111. OSStatus    FWStopLocalIsochronousPort (
  3112.     FWCommandObjectID            fwCommandObjectID);
  3113.  
  3114. OSStatus    FWContinueLocalIsochronousPort (
  3115.     FWCommandObjectID            fwCommandObjectID);
  3116.  
  3117. OSStatus    FWAllocateIsochPortCommandObject (
  3118.     FWCommandObjectID            *pFWCommandObjectID);
  3119.  
  3120. OSStatus    FWSetIsochPortCommandIsochPortID (
  3121.     FWCommandObjectID            fwCommandObjectID,
  3122.     IsochPortID                    isochPortID);
  3123.  
  3124. OSStatus    FWGetIsochPortCommandIsochPortID (
  3125.     FWCommandObjectID            fwCommandObjectID,
  3126.     IsochPortID                    *pIsochPortID);
  3127.  
  3128. OSStatus    FWCSRROMGetRootDirectory (
  3129.     FWReferenceID                fwReferenceID,
  3130.     CSRROMEntryID                *pCSRROMEntryID);
  3131.  
  3132. OSStatus    FWCSRROMGetEntryAddress (
  3133.     CSRROMEntryID                csrROMEntryID,
  3134.     UInt32                        *pAddress);
  3135.  
  3136. OSStatus    FWCSRROMGetEntryDataAddress (
  3137.     CSRROMEntryID                csrROMEntryID,
  3138.     UInt32                        *pAddress);
  3139.  
  3140. OSStatus    FWCSRROMCreateEntry (
  3141.     CSRROMEntryID                parentCSRROMEntryID,
  3142.     CSRROMEntryID                *pCSRROMEntryID,
  3143.     UInt32                        entryType,
  3144.     UInt32                        entryKeyValue,
  3145.     void                        *entryData,
  3146.     UInt32                        entrySize);
  3147.  
  3148. OSStatus    FWCSRROMDisposeEntry (
  3149.     CSRROMEntryID                csrROMEntryID);
  3150.  
  3151. OSStatus    FWCSRROMInstantiate (
  3152.     FWReferenceID                fwReferenceID);
  3153.  
  3154. OSStatus FWCSRROMCreateIterator (
  3155.     CSRROMEntryIterator            *pCSRROMIterator,
  3156.     FWReferenceID                fwReferenceID);
  3157.  
  3158. void FWCSRROMDisposeIterator (
  3159.     CSRROMEntryIterator            csrROMIterator);
  3160.  
  3161. OSStatus    FWCSRROMSetIterator (
  3162.     CSRROMEntryIterator            csrROMIterator,
  3163.     CSRROMEntryID                csrROMEntryID,
  3164.     CSRROMIterationOp            relationship);
  3165.  
  3166. OSStatus    FWCSRROMEntrySearch (
  3167.     CSRROMEntryIterator            csrROMIterator,
  3168.     CSRROMIterationOp            relationship,
  3169.     CSRROMEntryID                *pEntryID,
  3170.     Boolean                        *pDone,
  3171.     CSRROMSearchCriteriaPtr        pSearchCriteria,
  3172.     Ptr                            pEntryValue,
  3173.     UInt32                        *pEntrySize);
  3174.  
  3175. CSRROMEntryID    FWCSRROMCreateEntryID (void);
  3176.  
  3177. void  FWCSRROMDisposeEntryID (
  3178.     CSRROMEntryID                csrROMEntryID);
  3179.  
  3180. OSStatus    FWCSRROMCopyEntryID (
  3181.     CSRROMEntryID                srcCSRROMEntryID,
  3182.     CSRROMEntryID                *pDstCSRROMEntryID);
  3183.  
  3184. OSStatus    FWCSRROMCompareEntryIDs (
  3185.     CSRROMEntryID                csrROMEntryID1,
  3186.     CSRROMEntryID                csrROMEntryID2,
  3187.     Boolean                        *pCSRROMEntryIDsEqual);
  3188.  
  3189. void  FWCSRROMInvalidateEntryIDType (
  3190.     CSRROMEntryID                csrROMEntryID);
  3191.  
  3192. OSStatus    FWAllocateAddressSpace (
  3193.     FWAddressSpaceID            *pFWAddressSpaceID,
  3194.     FWReferenceID                fwReferenceID,
  3195.     FWAddressPtr                pFWAddress,
  3196.     UInt32                        size,
  3197.     Ptr                            addressBuffer,
  3198.     UInt32                        addressFlags,
  3199.     Ptr                            pAddressSpecificData);
  3200.  
  3201. OSStatus    FWDeallocateAddressSpace (
  3202.     FWAddressSpaceID            fwAddressSpaceID);
  3203.  
  3204. OSStatus    FWProcessReadRequest (
  3205.     FWIMProcessAsynchParamsPtr    pFWIMProcessAsynchParams);
  3206.  
  3207. OSStatus    FWProcessWriteRequest (
  3208.     FWIMProcessAsynchParamsPtr    pFWIMProcessAsynchParams);
  3209.  
  3210. OSStatus    FWProcessLockRequest (
  3211.     FWIMProcessAsynchParamsPtr    pFWIMProcessAsynchParams);
  3212.  
  3213. OSStatus    FWGetLocalFWReferenceIDFromFWReferenceID (
  3214.     FWReferenceID                fwReferenceID,
  3215.     FWReferenceID                *pLocalFWReferenceID);
  3216.  
  3217. OSStatus    FWGetFWDeviceIDFromFWReferenceID (
  3218.     FWReferenceID                fwReferenceID,
  3219.     FWDeviceID                    *pFWDeviceID);
  3220.  
  3221. OSStatus    FWFindFWDeviceFromNodeID (
  3222.     FWReferenceID                fwReferenceID,
  3223.     UInt32                        generation,
  3224.     UInt32                        nodeID,
  3225.     FWDeviceID                    *pFWDeviceID);
  3226.  
  3227. OSStatus    FWGetNodeID (
  3228.     FWReferenceID                fwReferenceID,
  3229.     UInt32                        *pNodeID,
  3230.     UInt32                        *pGenerationNumber);
  3231.  
  3232. OSStatus    FWGetUniqueID (
  3233.     FWReferenceID                fwReferenceID,
  3234.     CSRNodeUniqueIDPtr            pUniqueID);
  3235.  
  3236. OSStatus    FWGetUnitCSRROMEntryID (
  3237.     FWReferenceID                fwReferenceID,
  3238.     CSRROMEntryID                *pUnitCSRROMEntryID);
  3239.  
  3240. OSStatus    FWGetFWIsochResourceManagerID (
  3241.     FWReferenceID                fwReferenceID,
  3242.     FWIsochResourceManagerID    *pFWIsochResourceManagerID);
  3243.  
  3244. OSStatus    FWSetMaxPayloadSize (
  3245.     FWReferenceID                fwReferenceID,
  3246.     UInt32                        maxPayloadSize);
  3247.  
  3248. OSStatus    FWSetFWDeviceFlags(
  3249.     FWReferenceID                fwReferenceID,
  3250.     UInt32                        flags);
  3251.  
  3252. OSStatus    FWGetFWDeviceFlags(
  3253.     FWReferenceID                fwReferenceID,
  3254.     UInt32                        *flags);
  3255.  
  3256. OSStatus    FWClientCommandIsComplete (
  3257.     FWClientCommandID            fwClientCommandID,
  3258.     OSStatus                    commandStatus);
  3259.  
  3260. OSStatus    FWIMCommandIsComplete (
  3261.     FWIMCommandID                fwimCommandID,
  3262.     OSStatus                    commandStatus);
  3263.  
  3264. OSStatus    FWProcessBusReset (
  3265.     FWIMID                        fwimID);
  3266.  
  3267. void    FWProcessSelfIDs (
  3268.     FWIMProcessSelfIDsParamsPtr    pFWIMProcessSelfIDsParams);
  3269.  
  3270. OSStatus    FWCreateDeferredTask (
  3271.     FWDeferredTaskID            *pFWDeferredTaskID,
  3272.     FWDeferredTaskProcPtr        fwDeferredTaskProc,
  3273.     void                        *param1);
  3274.  
  3275. OSStatus    FWDisposeDeferredTask (
  3276.     FWDeferredTaskID            fwDeferredTaskID);
  3277.  
  3278. OSStatus    FWScheduleDeferredTask (
  3279.     FWDeferredTaskID            fwDeferredTaskID,
  3280.     void                        *param2);
  3281.  
  3282. OSStatus    FWGetCycleTime (
  3283.     FWReferenceID                fwReferenceID,
  3284.     UInt32                        *pCycleTime);
  3285.  
  3286. OSStatus    FWAllocatePhysicalAddressSpace (
  3287.     FWAddressSpaceID            *pFWAddressSpaceID,
  3288.     FWReferenceID                fwReferenceID,
  3289.     IOPreparationTable            *pIOPreparationTable);
  3290.  
  3291. OSStatus FWAllocatePCRAddressSpace(
  3292.     FWAddressSpaceID            *pFWAddressSpaceID,
  3293.     FWReferenceID                fwReferenceID,
  3294.     Ptr                            addressBuffer,
  3295.     UInt32                        addressFlags,
  3296.     Ptr                            pAddressSpecificData,
  3297.     Boolean                        inputPCR,
  3298.     UInt32                        preferredPlugNumber,
  3299.     UInt32                        *assignedPlugNumber );
  3300.  
  3301. OSStatus    FWInstallNewFWIM (
  3302.     RegEntryIDPtr                pFWIMRegEntry);
  3303.  
  3304. OSStatus    FWAllocatePowerCommandObject(
  3305.     FWCommandObjectID            *pFWCommandObjectID);
  3306.  
  3307. OSStatus    FWSetPowerCommandParams(
  3308.     FWCommandObjectID            fwCommandObjectID,
  3309.     UInt32                        minimumDeciVolts,
  3310.     UInt32                        totalDeciWattsRequested,
  3311.     UInt32                        totalDeciWattsAllocated,
  3312.     UInt32                        powerFlags);
  3313.  
  3314. OSStatus    FWGetPowerCommandParams(
  3315.     FWCommandObjectID            fwCommandObjectID,
  3316.     UInt32                        *pMinimumDeciVolts,
  3317.     UInt32                        *pTotalDeciWattsRequested,
  3318.     UInt32                        *pTotalDeciWattsAllocated,
  3319.     UInt32                        *pPowerFlags);
  3320.  
  3321. OSStatus    FWChangePower (
  3322.     FWCommandObjectID            fwCommandObjectID);
  3323.  
  3324. void    FWWaitForDeviceRePlug(
  3325.     FWCommandObjectID            fwCommandObjectID );
  3326.  
  3327. // We need to make this file a .i file so future direction stuff can be
  3328. // added without worries of it being distributed...
  3329. #if forVMBackingStore
  3330.  
  3331. void    FWIMEnableVMUserCode( void );
  3332. void    FWIMDisableVMUserCode( void );
  3333.  
  3334. #else
  3335.  
  3336. #define    FWIMEnableVMUserCode()
  3337. #define    FWIMDisableVMUserCode()
  3338.  
  3339. #endif
  3340.  
  3341. //zzz Put in Devices.h
  3342.  
  3343. /* Categories */
  3344.  
  3345. enum {
  3346.     kServiceCategoryFWIM        = 'fwim',                        /* FireWire interface module */
  3347.     kServiceCategoryFWDriver    = 'fwdv'                        /* FireWire device driver */
  3348. };
  3349.  
  3350. // End - Put in Devices.h
  3351.  
  3352. //zzz Put in Errors.h
  3353.  
  3354. enum {
  3355.     inUseErr                    = -4160,                // Item already in use
  3356.     notFoundErr                    = -4161,                // Item not found
  3357.     timeoutErr                    = -4162,                // Something timed out
  3358.     busReconfiguredErr            = -4163,                // Bus was reconfigured
  3359.     insufficientBandwidthErr    = -4164,                // Not enough bandwidth was available
  3360.     invalidIDErr                = -4165,                // Given ID is not valid.
  3361.     invalidIDTypeErr            = -4166,                // Given ID is of an invalid type for the requested operation.
  3362.     accessErr                    = -4167,                // Requested access not allowed.
  3363.     alreadyRegisteredErr        = -4168,                // Item has already been registered.
  3364.     disconnectedErr                = -4169,                // Target of request has been disconnected.
  3365.     retryExceededErr            = -4170,                // Retry limit was exceeded.
  3366.     addressRangeErr                = -4171,                // Address is not in range.
  3367.     addressAlignmentErr            = -4172,                // Address is not of proper alignment.
  3368.  
  3369.     multipleTalkerErr            = -4180,                // Tried to install multiple talkers
  3370.     channelActiveErr            = -4181,                // Operation not permitted when channel is active
  3371.     noListenerOrTalkerErr        = -4182,                // Every isochronous channel must have one talker and at least
  3372.                                                         // one listener
  3373.     noChannelsAvailableErr        = -4183,                // No supported isochronous channels are available
  3374.     channelNotAvailableErr        = -4184,                // Required channel was not available.
  3375.     invalidIsochPortIDErr        = -4185,                // An isochronous port ID is invalid.
  3376.     invalidFWReferenceTypeErr    = -4186,                // Operation does not support type of given reference ID
  3377.     separateBusErr                = -4187,                // Two or more entities are on two or more busses and cannot be associated with eachother.
  3378.     badSelfIDsErr                = -4188,                // Received self IDs are bad.
  3379.  
  3380. //zzz Do we own these next ID numbers?
  3381.     cableVoltageTooLowErr        = -4190,                // Cable power below device's minimum voltage
  3382.     cablePowerInsufficientErr    = -4191                    // Can't grant power request at this time
  3383. };
  3384.  
  3385. // end - Put in Errors.h
  3386.  
  3387. #if PRAGMA_ALIGN_SUPPORTED
  3388. #pragma options align=reset
  3389. #endif
  3390.  
  3391. #if PRAGMA_IMPORT_SUPPORTED
  3392. #pragma import off
  3393. #endif
  3394.  
  3395. #ifdef __cplusplus
  3396. }
  3397. #endif
  3398.  
  3399. #endif /* __FIREWIRE__ */
  3400.